Skip to content

Commit 64d0a73

Browse files
addaleaxjasnell
authored andcommitted
test: minor fixups for REPL eval tests
The `process.on("exit")` event handlers are unnecessary, so it’s okay to drop them. PR-URL: #11946 Ref: #11871 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent 76279cb commit 64d0a73

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

test/parallel/test-repl-empty.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const repl = require('repl');
99
const options = {
1010
eval: common.mustCall((cmd, context) => {
1111
// Assertions here will not cause the test to exit with an error code
12-
// so set a boolean that is checked in process.on('exit',...) instead.
12+
// so set a boolean that is checked later instead.
1313
evalCalledWithExpectedArgs = (cmd === '\n');
1414
})
1515
};
@@ -23,7 +23,5 @@ const repl = require('repl');
2323
r.write('.exit\n');
2424
}
2525

26-
process.on('exit', () => {
27-
assert(evalCalledWithExpectedArgs);
28-
});
26+
assert(evalCalledWithExpectedArgs);
2927
}

test/parallel/test-repl-eval.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const repl = require('repl');
99
const options = {
1010
eval: common.mustCall((cmd, context) => {
1111
// Assertions here will not cause the test to exit with an error code
12-
// so set a boolean that is checked in process.on('exit',...) instead.
12+
// so set a boolean that is checked later instead.
1313
evalCalledWithExpectedArgs = (cmd === 'function f() {}\n' &&
1414
context.foo === 'bar');
1515
})
@@ -29,7 +29,5 @@ const repl = require('repl');
2929
r.write('.exit\n');
3030
}
3131

32-
process.on('exit', () => {
33-
assert(evalCalledWithExpectedArgs);
34-
});
32+
assert(evalCalledWithExpectedArgs);
3533
}

0 commit comments

Comments
 (0)