Skip to content

Commit 23af483

Browse files
Merge remote-tracking branch 'upstream/master' into replace-babel-with-browserify
Conflicts: dist/debug.js test/.babelrc test/debug_spec.js
2 parents 3e1a15d + 6e934e9 commit 23af483

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/debug_spec.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (typeof module !== 'undefined') {
66
var expect = chai.expect;
77

88
var debug = require('../src/index');
9-
var sinon = require('sinon');
9+
var = require('sinon');
1010
var sinonChai = require("sinon-chai");
1111
chai.use(sinonChai);
1212
}
@@ -35,5 +35,22 @@ describe('debug', function () {
3535
expect(log.log).to.have.been.calledOnce;
3636
});
3737
});
38+
39+
describe('custom functions', () => {
40+
let log;
41+
42+
beforeEach(() => {
43+
debug.enable('test');
44+
log = debug('test');
45+
});
46+
47+
context('with log function', () => {
48+
it('uses it', () => {
49+
log.log = sinon.spy();
50+
log('using custom log function');
3851

52+
chai.assert.calledOnce(log.log);
53+
});
54+
});
55+
});
3956
});

0 commit comments

Comments
 (0)