mirror of
https://github.com/debug-js/debug.git
synced 2026-01-18 16:12:38 +00:00
32 lines
603 B
JavaScript
32 lines
603 B
JavaScript
import { expect } from 'chai';
|
|
import { assert, spy } from 'sinon';
|
|
|
|
import debug from '../index';
|
|
|
|
describe('debug', () => {
|
|
describe('sanity check', () => {
|
|
it('passes', () => {
|
|
const log = debug('test');
|
|
log('hello world');
|
|
});
|
|
});
|
|
|
|
describe('custom functions', () => {
|
|
let log;
|
|
|
|
beforeEach(() => {
|
|
debug.enable('test');
|
|
log = debug('test');
|
|
});
|
|
|
|
context('with log function', () => {
|
|
it('uses it', () => {
|
|
log.log = spy();
|
|
log('using custom log function');
|
|
|
|
assert.calledOnce(log.log);
|
|
});
|
|
});
|
|
});
|
|
});
|