Skip to content

Commit

Permalink
test: refactor before/after
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed May 11, 2018
1 parent 36834c2 commit b85ca3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
12 changes: 4 additions & 8 deletions test/programmatic/custom_action.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ var pm2 = require('../..');
var should = require('should');

describe('Custom actions via CLI/API', function() {
after(function(done) {
pm2.kill(done);
before(function(done) {
pm2.delete('all', function() { done() });
});

before(function(done) {
pm2.connect(function() {
pm2.kill(function() {
pm2.connect(done);
})
});
after(function(done) {
pm2.delete('all', function() { done() });
});

it('should start custom action script', function(done) {
Expand Down
14 changes: 3 additions & 11 deletions test/programmatic/id.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ describe('Unique ID verification', function() {
var _id = null

before(function(done) {
PM2.kill(done);
PM2.delete('all', function() { done() });
});

it('should connect to PM2', function(done) {
PM2.connect(done);
after(function(done) {
PM2.delete('all', function() { done() });
});

it('should start a script', function(done) {
Expand Down Expand Up @@ -78,13 +78,5 @@ describe('Unique ID verification', function() {
});
});
});

after(function(done) {
PM2.delete('all', done);
});

after(function(done) {
PM2.kill(done);
});
});
});

0 comments on commit b85ca3c

Please sign in to comment.