test: minor fixups for REPL eval tests
The `process.on("exit")` event handlers are unnecessary, so it’s okay to drop them. PR-URL: https://github.com/nodejs/node/pull/11946 Ref: https://github.com/nodejs/node/pull/11871 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
76279cbb5c
commit
64d0a73574
@ -9,7 +9,7 @@ const repl = require('repl');
|
|||||||
const options = {
|
const options = {
|
||||||
eval: common.mustCall((cmd, context) => {
|
eval: common.mustCall((cmd, context) => {
|
||||||
// Assertions here will not cause the test to exit with an error code
|
// 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');
|
evalCalledWithExpectedArgs = (cmd === '\n');
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@ -23,7 +23,5 @@ const repl = require('repl');
|
|||||||
r.write('.exit\n');
|
r.write('.exit\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
process.on('exit', () => {
|
|
||||||
assert(evalCalledWithExpectedArgs);
|
assert(evalCalledWithExpectedArgs);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ const repl = require('repl');
|
|||||||
const options = {
|
const options = {
|
||||||
eval: common.mustCall((cmd, context) => {
|
eval: common.mustCall((cmd, context) => {
|
||||||
// Assertions here will not cause the test to exit with an error code
|
// 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' &&
|
evalCalledWithExpectedArgs = (cmd === 'function f() {}\n' &&
|
||||||
context.foo === 'bar');
|
context.foo === 'bar');
|
||||||
})
|
})
|
||||||
@ -29,7 +29,5 @@ const repl = require('repl');
|
|||||||
r.write('.exit\n');
|
r.write('.exit\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
process.on('exit', () => {
|
|
||||||
assert(evalCalledWithExpectedArgs);
|
assert(evalCalledWithExpectedArgs);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user