Skip to content

Commit

Permalink
fix: remove ES6 features since this also now runs on the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
yamikuronue committed Dec 19, 2016
1 parent 92e0e88 commit 0d7c9eb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/debug_spec.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
/* global describe, it */
'use strict'

if (typeof module !== 'undefined' && module.exports) {
const chai = require('chai');
const expect = chai.expect;
if (typeof module !== 'undefined') {
var chai = require('chai');
var expect = chai.expect;

const debug = require('../src/index');
const sinon = require('sinon');
var debug = require('../src/index');
var sinon = require('sinon');
var sinonChai = require("sinon-chai");
chai.use(sinonChai);
}

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

debug.log = dummyConsole;


describe('debug', function () {
const log = debug('test');
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;
Expand Down

0 comments on commit 0d7c9eb

Please sign in to comment.