Skip to content

Commit 1b83359

Browse files
committed
Make it so mocha tests can console.log
1 parent 6d5583f commit 1b83359

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,16 @@ describe('utils.js', function() {
7272
describe('api.js', function() {
7373
var api = require('../api');
7474
beforeEach(function() {
75-
this.sinon.stub(console, 'log');
75+
var log = console.log;
76+
this.sinon.stub(console, 'log', function() {
77+
return log.apply(log, arguments);
78+
});
79+
});
80+
81+
afterEach(function() {
82+
console.log.restore();
7683
});
84+
7785
describe('#api()', function() {
7886
it('action not found', function() {
7987
api.api('notARealAction');

0 commit comments

Comments
 (0)