Skip to content

Commit

Permalink
fix: Whoops, didn't merge the tests properly. Resolved.
Browse files Browse the repository at this point in the history
  • Loading branch information
yamikuronue committed Dec 20, 2016
1 parent 2a01c6c commit 67182fd
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions test/debug_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global describe, it */
'use strict'
/* global describe, it, context, beforeEach */
'use strict';

if (typeof module !== 'undefined') {
var chai = require('chai');
Expand All @@ -11,47 +11,28 @@ if (typeof module !== 'undefined') {
chai.use(sinonChai);
}

var dummyConsole = {
log: function() {
//dummy function
}
};


describe('debug', function () {
var log = debug('test');

log.log = sinon.stub();
it('passes a basic sanity check', function () {
expect(log('hello world')).to.not.throw;
});

it('Should output to the log function', function () {
debug.log = dummyConsole.log;
sinon.spy(dummyConsole, 'log');
log('Hello world');
//expect(dummyConsole.log).to.have.been.called;
});
<<<<<<< HEAD
=======
});

describe('custom functions', () => {
let log;
it('passes a basic sanity check', function () {
expect(log('hello world')).to.not.throw;
});

beforeEach(() => {
context('with log function', function () {

beforeEach(function () {
debug.enable('test');
log = debug('test');
});

it('uses it', function () {
log.log = sinon.stub();
log('using custom log function');

context('with log function', () => {
it('uses it', () => {
log.log = spy();
log('using custom log function');

assert.calledOnce(log.log);
});
expect(log.log).to.have.been.calledOnce;
});
});
>>>>>>> upstream/master
});

0 comments on commit 67182fd

Please sign in to comment.