From eb4e8681d68fe136f755c2cd612aeb0b6caa6751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 3 Sep 2014 17:38:38 +0200 Subject: [PATCH] Fix tests --- test/server/phantomasWrapperTest.js | 11 ++++++----- test/server/testQueueTest.js | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/test/server/phantomasWrapperTest.js b/test/server/phantomasWrapperTest.js index 8010f38..6b4ee77 100644 --- a/test/server/phantomasWrapperTest.js +++ b/test/server/phantomasWrapperTest.js @@ -8,7 +8,7 @@ describe('phantomasWrapper', function() { }); it('should execute', function(done) { - var url = 'http://www.google.fr'; + var url = 'http://www.google.fr/'; this.timeout(15000); phantomasWrapper.execute({ @@ -21,11 +21,12 @@ describe('phantomasWrapper', function() { should.not.exist(err); json.should.be.an('object'); - json.should.have.a.property('generator').that.contains('phantomas'); + json.should.have.a.property('generator'); + json.generator.should.contain('phantomas'); json.should.have.a.property('url').that.equals(url); - json.should.have.a.property('metrics').that.is.an('object').not.empty(); - json.should.have.a.property('offenders').that.is.an('object').not.empty(); - json.offenders.should.have.a.property('javascriptExecutionTree').that.is.a('string'); + json.should.have.a.property('metrics').that.is.an('object').not.empty; + json.should.have.a.property('offenders').that.is.an('object').not.empty; + json.offenders.should.have.a.property('javascriptExecutionTree').that.is.a('array').not.empty; done(); }); diff --git a/test/server/testQueueTest.js b/test/server/testQueueTest.js index 47bce4f..6ae1be6 100644 --- a/test/server/testQueueTest.js +++ b/test/server/testQueueTest.js @@ -3,9 +3,21 @@ var testQueue = require('../../app/lib/testQueue.js'); describe('testQueue', function() { - it('should have a method push', function() { + var url = 'http://www.not.existing'; + + it('should accept a new test with method push', function() { testQueue.should.have.property('push').that.is.a('function'); - + + var task = { + testId: 'aaaaa', + url: url, + options: {} + }; + + testQueue.push(task, function(err, json, results) { + done(); + }); + }); }); \ No newline at end of file