diff --git a/package.json b/package.json index eed79c0..5bb8f24 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,9 @@ "matchdep": "^0.3.0", "mocha": "^2.0.1", "phantomjs": "^1.9.10", - "q": "^1.1.2" + "q": "^1.1.2", + "sinon": "^1.12.1", + "sinon-chai": "^2.6.0" }, "scripts": { "test": "grunt test" diff --git a/test/api/yellowlabtoolsTest.js b/test/api/yellowlabtoolsTest.js index ddc285e..89c36ab 100644 --- a/test/api/yellowlabtoolsTest.js +++ b/test/api/yellowlabtoolsTest.js @@ -1,6 +1,11 @@ -var should = require('chai').should(); +var chai = require('chai'); +var sinon = require('sinon'); +var sinonChai = require('sinon-chai'); +var should = chai.should(); var YellowLabTools = require('../../lib/yellowlabtools.js'); +chai.use(sinonChai); + describe('yellowlabtools', function() { @@ -28,6 +33,9 @@ describe('yellowlabtools', function() { it('succeeds on simple-page.html', function(done) { this.timeout(15000); + // Check if console.log is called + sinon.spy(console, 'log') + var url = 'http://localhost:8388/simple-page.html'; var ylt = new YellowLabTools(url) @@ -67,6 +75,8 @@ describe('yellowlabtools', function() { "offenders": ["body > h1[1]"] }); + console.log.should.not.have.been.called; + done(); }).fail(function(err) { done(err);