nodejs/test/parallel/test-repl-close.js
Dario Piotrowicz 39ab68b2c1
readline: add stricter validation for functions called after closed
PR-URL: https://github.com/nodejs/node/pull/58283
Fixes: https://github.com/nodejs/node/issues/57678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-05-18 19:46:38 +00:00

19 lines
423 B
JavaScript

'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');