From 64d0a735741558e8c715b86531b51e6f57dc3bd7 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 20 Mar 2017 22:21:54 +0100 Subject: [PATCH] test: minor fixups for REPL eval tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Evan Lucas Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- test/parallel/test-repl-empty.js | 6 ++---- test/parallel/test-repl-eval.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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); }