From 5113e11da764d2c55bddc01cb0d6a2b9911e5b65 Mon Sep 17 00:00:00 2001 From: Stseb Date: Tue, 24 Jan 2017 14:17:23 +0100 Subject: [PATCH] test: after is added --- tests/unit/test-cmd/test.run.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-cmd/test.run.js b/tests/unit/test-cmd/test.run.js index dd52c04ce8..9f2950d4e2 100644 --- a/tests/unit/test-cmd/test.run.js +++ b/tests/unit/test-cmd/test.run.js @@ -2,7 +2,7 @@ import path from 'path'; import EventEmitter from 'events'; -import {describe, it} from 'mocha'; +import {describe, it, after} from 'mocha'; import {assert} from 'chai'; import sinon from 'sinon'; @@ -237,6 +237,10 @@ describe('run', () => { }); }); + after(() => { + process.exit.restore(); + }); + it('exits when user presses CTRL+C in shell console', () => { const cmd = prepareRun(); const exits = sinon.stub(process, 'exit', sinon.spy(() => {})); @@ -247,7 +251,6 @@ describe('run', () => { }) .then(() => { assert.ok(exits.called); - process.exit.restore(); }); });