From c5d35aca3382c7b79dba473138e69ec2ba97b6a7 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 17 Apr 2012 11:34:37 -0700 Subject: [PATCH] test: check for multiple "emit" calls in repl-end-emits-exit.js --- test/simple/test-repl-end-emits-exit.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/simple/test-repl-end-emits-exit.js b/test/simple/test-repl-end-emits-exit.js index 375c0f814f..46eca2efbf 100644 --- a/test/simple/test-repl-end-emits-exit.js +++ b/test/simple/test-repl-end-emits-exit.js @@ -23,8 +23,8 @@ var common = require('../common'), assert = require('assert'), Stream = require('stream'), repl = require('repl'), - gotTerminalExit = false, - gotRegularExit = false; + terminalExit = 0, + regularExit = 0; // create a dummy stream that does nothing var stream = new Stream(); @@ -45,7 +45,7 @@ function testTerminalMode() { r1.on('exit', function() { // should be fired from the simulated ^D keypress - gotTerminalExit = true; + terminalExit++; testRegularMode(); }); } @@ -63,13 +63,13 @@ function testRegularMode() { r2.on('exit', function() { // should be fired from the simulated 'end' event - gotRegularExit = true; + regularExit++; }); } process.on('exit', function() { - assert(gotTerminalExit); - assert(gotRegularExit); + assert.equal(terminalExit, 1); + assert.equal(regularExit, 1); });