MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / throws

Function throws

tests/js/quint.js:37–49  ·  view source on GitHub ↗
(fn, error)

Source from the content-addressed store, hash-verified

35 if (JSON.stringify(a) !== JSON.stringify(b)) throw new Error(`'${a}' does not equal to '${b}'`);
36 },
37 throws(fn, error)
38 {
39 try
40 {
41 fn();
42 }
43 catch (err)
44 {
45 if (!err.toString().includes(error)) throw new Error(`'${fn}' throws '${err}' but expects '${error}'`);
46 return;
47 }
48 throw new Error(`'${fn}' does not throw`);
49 },
50 looksNative(fn)
51 {
52 if (!fn.toString().includes('[native code]')) throw new Error(`'${fn}' does not look native`);

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected