nodejs/test/parallel/test-repl-close.js

19 lines
423 B
JavaScript
Raw Permalink Normal View History

'use strict';
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const child = cp.spawn(process.execPath, ['--interactive']);
let output = '';
child.stdout.on('data', (data) => {
output += data;
});
child.on('exit', common.mustCall(() => {
assert.doesNotMatch(output, /Uncaught Error/);
}));
child.stdin.write('await null;\n');
child.stdin.write('.exit\n');