MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / throwError

Function throwError

javascript/2704-to-be-or-not-to-be.js:10–12  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

8 */
9const 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'),

Callers 1

expectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected