We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3e1a15d + 6e934e9 commit 23af483Copy full SHA for 23af483
test/debug_spec.js
@@ -6,7 +6,7 @@ if (typeof module !== 'undefined') {
6
var expect = chai.expect;
7
8
var debug = require('../src/index');
9
- var sinon = require('sinon');
+ var = require('sinon');
10
var sinonChai = require("sinon-chai");
11
chai.use(sinonChai);
12
}
@@ -35,5 +35,22 @@ describe('debug', function () {
35
expect(log.log).to.have.been.calledOnce;
36
});
37
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');
51
52
+ chai.assert.calledOnce(log.log);
53
54
55
56
0 commit comments