diff --git a/test/parallel/test-repl-empty.js b/test/parallel/test-repl-empty.js index e9794d9bea45c6..44281f117f0bba 100644 --- a/test/parallel/test-repl-empty.js +++ b/test/parallel/test-repl-empty.js @@ -9,7 +9,7 @@ const repl = require('repl'); const options = { eval: common.mustCall((cmd, context) => { // Assertions here will not cause the test to exit with an error code - // so set a boolean that is checked in process.on('exit',...) instead. + // so set a boolean that is checked later instead. evalCalledWithExpectedArgs = (cmd === '\n'); }) }; @@ -23,7 +23,5 @@ const repl = require('repl'); r.write('.exit\n'); } - process.on('exit', () => { - assert(evalCalledWithExpectedArgs); - }); + assert(evalCalledWithExpectedArgs); } diff --git a/test/parallel/test-repl-eval.js b/test/parallel/test-repl-eval.js index 1eb4e2371c704a..7508e14d8bd024 100644 --- a/test/parallel/test-repl-eval.js +++ b/test/parallel/test-repl-eval.js @@ -9,7 +9,7 @@ const repl = require('repl'); const options = { eval: common.mustCall((cmd, context) => { // Assertions here will not cause the test to exit with an error code - // so set a boolean that is checked in process.on('exit',...) instead. + // so set a boolean that is checked later instead. evalCalledWithExpectedArgs = (cmd === 'function f() {}\n' && context.foo === 'bar'); }) @@ -29,7 +29,5 @@ const repl = require('repl'); r.write('.exit\n'); } - process.on('exit', () => { - assert(evalCalledWithExpectedArgs); - }); + assert(evalCalledWithExpectedArgs); }