Skip to content

Commit

Permalink
fixup test
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Oct 10, 2019
1 parent 28e7782 commit 38554bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/es-module/test-cjs-esm-warn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const common = require('../common');
const fixtures = require('../common/fixtures');
const { spawn } = require('child_process');
const assert = require('assert');
const path = require('path');

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

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

0 comments on commit 38554bc

Please sign in to comment.