From 67182fdb001d51c4dde667dc43d8ccbc791bd716 Mon Sep 17 00:00:00 2001 From: Yami Date: Tue, 20 Dec 2016 12:33:56 +0000 Subject: [PATCH] fix: Whoops, didn't merge the tests properly. Resolved. --- test/debug_spec.js | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/test/debug_spec.js b/test/debug_spec.js index f7a6e51d..2df05235 100644 --- a/test/debug_spec.js +++ b/test/debug_spec.js @@ -1,5 +1,5 @@ -/* global describe, it */ -'use strict' +/* global describe, it, context, beforeEach */ +'use strict'; if (typeof module !== 'undefined') { var chai = require('chai'); @@ -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 });