|
@@ -13,16 +13,19 @@ describe('phantomasWrapper', function() {
|
|
this.timeout(15000);
|
|
this.timeout(15000);
|
|
|
|
|
|
phantomasWrapper.execute({
|
|
phantomasWrapper.execute({
|
|
- url: url,
|
|
|
|
- options: {}
|
|
|
|
- }).then(function(json) {
|
|
|
|
- json.should.be.an('object');
|
|
|
|
- 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('array').not.empty;
|
|
|
|
|
|
+ params: {
|
|
|
|
+ url: url,
|
|
|
|
+ options: {}
|
|
|
|
+ }
|
|
|
|
+ }).then(function(data) {
|
|
|
|
+
|
|
|
|
+ data.should.be.an('object');
|
|
|
|
+ data.should.have.a.property('generator');
|
|
|
|
+ data.generator.should.contain('phantomas');
|
|
|
|
+ data.should.have.a.property('url').that.equals(url);
|
|
|
|
+ data.should.have.a.property('metrics').that.is.an('object').not.empty;
|
|
|
|
+ data.should.have.a.property('offenders').that.is.an('object').not.empty;
|
|
|
|
+ data.offenders.should.have.a.property('javascriptExecutionTree').that.is.a('array').not.empty;
|
|
|
|
|
|
done();
|
|
done();
|
|
}).fail(function(err) {
|
|
}).fail(function(err) {
|
|
@@ -36,9 +39,11 @@ describe('phantomasWrapper', function() {
|
|
this.timeout(15000);
|
|
this.timeout(15000);
|
|
|
|
|
|
phantomasWrapper.execute({
|
|
phantomasWrapper.execute({
|
|
- url: url,
|
|
|
|
- options: {}
|
|
|
|
- }).then(function(json) {
|
|
|
|
|
|
+ params: {
|
|
|
|
+ url: url,
|
|
|
|
+ options: {}
|
|
|
|
+ }
|
|
|
|
+ }).then(function(data) {
|
|
|
|
|
|
done('Error: unwanted success');
|
|
done('Error: unwanted success');
|
|
|
|
|
|
@@ -56,19 +61,21 @@ describe('phantomasWrapper', function() {
|
|
|
|
|
|
this.timeout(5000);
|
|
this.timeout(5000);
|
|
phantomasWrapper.execute({
|
|
phantomasWrapper.execute({
|
|
- url: url,
|
|
|
|
- options: {
|
|
|
|
- timeout: 1
|
|
|
|
|
|
+ params: {
|
|
|
|
+ url: url,
|
|
|
|
+ options: {
|
|
|
|
+ timeout: 1
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }).then(function(json) {
|
|
|
|
|
|
+ }).then(function(data) {
|
|
|
|
|
|
- json.should.be.an('object');
|
|
|
|
- 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('array').not.empty;
|
|
|
|
|
|
+ data.should.be.an('object');
|
|
|
|
+ data.should.have.a.property('generator');
|
|
|
|
+ data.generator.should.contain('phantomas');
|
|
|
|
+ data.should.have.a.property('url').that.equals(url);
|
|
|
|
+ data.should.have.a.property('metrics').that.is.an('object').not.empty;
|
|
|
|
+ data.should.have.a.property('offenders').that.is.an('object').not.empty;
|
|
|
|
+ data.offenders.should.have.a.property('javascriptExecutionTree').that.is.a('array').not.empty;
|
|
|
|
|
|
done();
|
|
done();
|
|
}).fail(function(err) {
|
|
}).fail(function(err) {
|