(fn, error)
| 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`); |