()
| 221 | } |
| 222 | |
| 223 | function checkInvalidCachedData() { |
| 224 | [true, false, 'foo', {}, Array, function() {}].forEach((invalidArg) => { |
| 225 | const message = 'The "options.cachedData" property must be an ' + |
| 226 | 'instance of Buffer, TypedArray, or DataView.' + |
| 227 | common.invalidArgTypeHelper(invalidArg); |
| 228 | assert.throws( |
| 229 | () => new SourceTextModule('import "foo";', { cachedData: invalidArg }), |
| 230 | { |
| 231 | code: 'ERR_INVALID_ARG_TYPE', |
| 232 | name: 'TypeError', |
| 233 | message, |
| 234 | } |
| 235 | ); |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | function checkGettersErrors() { |
| 240 | const expectedError = { name: 'TypeError' }; |
no test coverage detected
searching dependent graphs…