Skip to content

Commit

Permalink
review comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
giltayar committed Jul 13, 2021
1 parent 20f3a00 commit 1d6a72b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
23 changes: 7 additions & 16 deletions test/integration/esm.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
'use strict';
var path = require('path');
const {
runMochaJSON: run,
runMochaAsync,
invokeMochaAsync,
resolveFixturePath
} = require('./helpers');
const {runMochaJSON: run, runMochaAsync} = require('./helpers');
var utils = require('../../lib/utils');
var args =
+process.versions.node.split('.')[0] >= 13 ? [] : ['--experimental-modules'];
Expand Down Expand Up @@ -89,17 +84,13 @@ describe('esm', function() {
const fixture =
'esm/type-module/test-that-imports-non-existing-module.fixture.js';

const [, promise] = invokeMochaAsync(
[resolveFixturePath(fixture), '--unhandled-rejections=warn'],
{stdio: 'pipe'}
);
const result = await promise;
const err = await runMochaAsync(fixture, ['--unhandled-rejections=warn'], {
stdio: 'pipe'
}).catch(err => err);

expect(result, 'to have failed with output', /ERR_MODULE_NOT_FOUND/);
expect(
result,
'to have failed with output',
/test-that-imports-non-existing-module/
expect(err.output, 'to contain', 'ERR_MODULE_NOT_FOUND').and(
'to contain',
'test-that-imports-non-existing-module'
);
});
});
2 changes: 1 addition & 1 deletion test/integration/fixtures/esm/type-module/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"type": "module"
}
}

0 comments on commit 1d6a72b

Please sign in to comment.