Test that console.log is never called
This commit is contained in:
+3
-1
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user