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 17, 2022
1 parent e6470c8 commit f32ca7c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/es-module/test-esm-repl-imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';
require('../common');
const assert = require('assert');
const path = require('path');
const { spawn } = require('child_process');

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

child.stdin.end(`
try { require('#test'); process.exit(0); }
catch (e) { process.exit(-1); }
`);

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

0 comments on commit f32ca7c

Please sign in to comment.