Fix tests

This commit is contained in:
Gaël Métais
2014-09-03 17:38:38 +02:00
parent 8c260fe5ed
commit eb4e8681d6
2 changed files with 20 additions and 7 deletions
+6 -5
View File
@@ -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();
});
+14 -2
View File
@@ -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();
});
});
});