(val)
| 7 | * - notToBe(expected): Returns true if val !== expected, otherwise throws an error "Equal". |
| 8 | */ |
| 9 | const expect = (val) => { |
| 10 | const throwError = (message) => { |
| 11 | throw new Error(message); |
| 12 | }; |
| 13 | return { |
| 14 | toBe: (expected) => val === expected || throwError('Not Equal'), |
| 15 | notToBe: (expected) => val !== expected || throwError('Equal'), |
| 16 | }; |
| 17 | }; |
| 18 | |
| 19 | // Example usage: |
| 20 | // expect(5).toBe(5); // returns true |
nothing calls this directly
no test coverage detected