Skip to content

Commit

Permalink
test: after is added
Browse files Browse the repository at this point in the history
  • Loading branch information
saintsebastian committed Jan 24, 2017
1 parent 0d81e24 commit 5113e11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit/test-cmd/test.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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(() => {}));
Expand All @@ -247,7 +251,6 @@ describe('run', () => {
})
.then(() => {
assert.ok(exits.called);
process.exit.restore();
});
});

Expand Down

0 comments on commit 5113e11

Please sign in to comment.