Skip to content

Commit

Permalink
change to assert.match()
Browse files Browse the repository at this point in the history
  • Loading branch information
bmacnaughton committed Nov 6, 2023
1 parent 2862eb0 commit ef738f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/es-module/test-esm-loader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ await assert.rejects(

try {
await import('esmHook/commonJsNullSource.mjs');
} catch (e) {
assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE');
assert(e.message.includes('"source"'));
assert(e.message.includes('"load"'));
assert(e.message.includes('got null'));
} catch ({ code, message }) {
assert.strictEqual(code, 'ERR_INVALID_RETURN_PROPERTY_VALUE');
assert.match(message, /"source"/);
assert.match(message, /"load"/);
assert.match(message, /got null/);
}

await import('../fixtures/es-module-loaders/js-as-esm.js')
Expand Down

0 comments on commit ef738f8

Please sign in to comment.