Skip to content

Commit 38554bc

Browse files
committed
fixup test
1 parent 28e7782 commit 38554bc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/es-module/test-cjs-esm-warn.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const common = require('../common');
44
const fixtures = require('../common/fixtures');
55
const { spawn } = require('child_process');
66
const assert = require('assert');
7+
const path = require('path');
78

89
const entry = fixtures.path('/es-modules/cjs-esm.js');
910

@@ -17,8 +18,8 @@ child.on('close', common.mustCall((code, signal) => {
1718
assert.strictEqual(code, 0);
1819
assert.strictEqual(signal, null);
1920
assert.strictEqual(stderr, `(node:${child.pid}) Warning: require() of .js ` +
20-
`file ${entry} is not supported as it is an ES module due to having ` +
21-
'"type": "module" in its package.json file.\nRather use import to load ' +
22-
'this module, or if you are the author you may want to use the .cjs ' +
23-
'extension for this file.\n');
21+
`file ${path.resolve(entry, '../package-type-module/cjs.js')} is not ` +
22+
'supported as it is an ES module due to having "type": "module" in its ' +
23+
'package.json file.\nRather use import to load this module, or if you ' +
24+
'are the author you may want to use the .cjs extension for this file.\n');
2425
}));

0 commit comments

Comments
 (0)