Skip to content

Commit

Permalink
(test) activate true
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Feb 22, 2017
1 parent cf45c77 commit b008b4a
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions test/vxx.e2e.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function listenRev(cb) {
}

describe('Programmatically test interactor', function() {
this.timeout(8000);
this.timeout(3000);
var pm2;

before(function(done) {
Expand All @@ -48,11 +48,6 @@ describe('Programmatically test interactor', function() {
});

describe('application testing', function() {
afterEach(function() {
//console.log(sub);
//sub.unsubscribe();
});

it('should start test application', function(done) {
sub.once('message', function(data) {
var packet = JSON.parse(data);
Expand All @@ -63,11 +58,10 @@ describe('Programmatically test interactor', function() {
pm2.start({
script : 'app.js',
name : 'API',
env: {
"DEBUG": "*"
}
trace : true
}, function(err, data) {

if (err)
console.error(err);
});
});

Expand Down Expand Up @@ -107,14 +101,16 @@ describe('Programmatically test interactor', function() {
if (packet.data['axm:transaction']) {
var data = packet.data['axm:transaction'][0].data;
// Should now route summary contains 4 routes
Object.keys(data.routes).length.should.eql(4);
// Object.keys(data.routes).length.should.eql(3);

var route = data.routes.filter(function (route) {
return route.path === '/db1/save';
})[0];

if (!route) return callAgain();

// Should count 10 transactions
route.variances[0].count.should.eql(10);
//console.log(packet.data['axm:transaction'][0].data.routes['/db1/save']);
route.variances[0].spans.length.should.eql(2);
route.variances[0].spans[1].name.should.eql('mongo-insert');
done();
Expand All @@ -134,13 +130,16 @@ describe('Programmatically test interactor', function() {

if (packet.data['axm:transaction']) {
var data = packet.data['axm:transaction'][0].data;
// Should now route summary contains 5 routes
Object.keys(data.routes).length.should.eql(5);

var route = data.routes.filter(function (route) {
return route.path === '/db1/get';
})[0];

if (!route) return callAgain();

// Should now route summary contains 5 routes
Object.keys(data.routes).length.should.eql(5);

// @bug: should contain only 1 transaction not 2 (only find)
route.variances[0].spans.length.should.eql(2);

Expand Down Expand Up @@ -181,7 +180,6 @@ describe('Programmatically test interactor', function() {
pm2.trigger('API', 'db1multi');
});


});

});
});

0 comments on commit b008b4a

Please sign in to comment.