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(); }); });