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 18, 2022
1 parent 5521da2 commit c9cf788
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/es-module/test-esm-repl-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'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 c9cf788

Please sign in to comment.