()
| 200 | |
| 201 | // Check for error thrown when breakOnSigint is not a boolean for evaluate() |
| 202 | async function checkInvalidOptionForEvaluate() { |
| 203 | await assert.rejects(async () => { |
| 204 | const m = new SourceTextModule('export const a = 1; export let b = 2'); |
| 205 | await m.evaluate({ breakOnSigint: 'a-string' }); |
| 206 | }, { |
| 207 | name: 'TypeError', |
| 208 | message: |
| 209 | 'The "options.breakOnSigint" property must be of type boolean. ' + |
| 210 | "Received type string ('a-string')", |
| 211 | code: 'ERR_INVALID_ARG_TYPE' |
| 212 | }); |
| 213 | |
| 214 | { |
| 215 | ['link', 'evaluate'].forEach(async (method) => { |
| 216 | await assert.rejects(async () => { |
| 217 | await Module.prototype[method](); |
| 218 | }, { code: 'ERR_INVALID_THIS' }); |
| 219 | }); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | function checkInvalidCachedData() { |
| 224 | [true, false, 'foo', {}, Array, function() {}].forEach((invalidArg) => { |
no test coverage detected
searching dependent graphs…