MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / assert

Function assert

example/tests/gm_xhr_test.js:1941–1943  ·  view source on GitHub ↗
(condition, msg)

Source from the content-addressed store, hash-verified

1939
1940 // ---------- Assertion utils ----------
1941 function assert(condition, msg) {
1942 if (!condition) throw new Error(msg || "assertion failed");
1943 }
1944 function assertEq(a, b, msg) {
1945 if (a !== b) throw new Error(msg ? `${msg}: expected ${b}, got ${a}` : `expected ${b}, got ${a}`);
1946 }

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected