Skip to content

Commit 03c10ae

Browse files
author
Giovanni
committed
esm: refactored the directory test to check for the error code
1 parent 6031522 commit 03c10ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/es-module/test-esm-type-field-errors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ describe('ESM type field errors', { concurrency: true }, () => {
4545
});
4646

4747
it('--input-type=module disallowed for directories', () => {
48-
assert.throws(() => require('../fixtures/es-modules/package-type-module/index.js'), /ERR_REQUIRE_ESM/);
48+
assert.throws(() => require('../fixtures/es-modules/package-type-module/index.js'), {
49+
code: 'ERR_REQUIRE_ESM'
50+
});
4951
});
5052
});
5153

0 commit comments

Comments
 (0)