diff --git a/test/programmatic/custom_action.mocha.js b/test/programmatic/custom_action.mocha.js index 9de735f8e..6df8aaf3c 100644 --- a/test/programmatic/custom_action.mocha.js +++ b/test/programmatic/custom_action.mocha.js @@ -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) { diff --git a/test/programmatic/id.mocha.js b/test/programmatic/id.mocha.js index f792e7ef0..1d879859d 100644 --- a/test/programmatic/id.mocha.js +++ b/test/programmatic/id.mocha.js @@ -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) { @@ -78,13 +78,5 @@ describe('Unique ID verification', function() { }); }); }); - - after(function(done) { - PM2.delete('all', done); - }); - - after(function(done) { - PM2.kill(done); - }); }); });