Skip to content

Commit

Permalink
test: add test for repl subpath imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rayw000 committed Jun 20, 2022
1 parent e045900 commit a12db35
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/es-module/test-esm-repl-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
const { mustCall } = require('../common');
const assert = require('assert');
const fixtures = require('../common/fixtures');
const { spawn } = require('child_process');

const child = spawn(process.execPath, [
'--interactive',
], {
cwd: fixtures.path('es-modules', 'pkgimports'),
});

child.stdin.end(
'try{require("#test");await import("#test")}catch{process.exit(-1)}'
);

child.on('exit', mustCall((code) => {
assert.strictEqual(code, 0);
}));

0 comments on commit a12db35

Please sign in to comment.