Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/test-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ globals.options = opts;

const serializeError = require('./serialize-error');

(opts.require || []).forEach(x => require(x));
(opts.require || []).forEach(x => {
if (/[/\\]@std[/\\]esm[/\\]index\.js$/.test(x)) {
require = require(x)(module); // eslint-disable-line no-global-assign
} else {
require(x);
}
});

adapter.installSourceMapSupport();
adapter.installPrecompilerHook();
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"update-notifier": "^2.3.0"
},
"devDependencies": {
"@std/esm": "^0.19.1",
"cli-table2": "^0.2.0",
"codecov": "^3.0.0",
"del": "^3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions test/fixture/std-esm/.esmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"esm": "cjs"
}
1 change: 1 addition & 0 deletions test/fixture/std-esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'foo';
6 changes: 6 additions & 0 deletions test/fixture/std-esm/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import test from '../../../';
import m from '.';

test('works', t => {
t.is(m, 'foo');
});
11 changes: 11 additions & 0 deletions test/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ test('babelrc is ignored', t => {
});
});

test('@std/esm support', t => {
return fork(fixture('std-esm/test.js'), {
require: [require.resolve('@std/esm')]
})
.run({})
.then(info => {
t.is(info.stats.passCount, 1);
t.end();
});
});

// TODO: Skipped until we can do this properly in #1455
test('color support is initialized correctly', t => {
t.plan(1);
Expand Down