From 2e6eb0941ce9cca295fcfda61d004aacd2036671 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 1 Jul 2016 16:04:44 +0200 Subject: [PATCH] move EC2 cleanup to simply after() --- test/selfhost-ec2-create-test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/selfhost-ec2-create-test.js b/test/selfhost-ec2-create-test.js index 5b1eb66..af3dbfa 100644 --- a/test/selfhost-ec2-create-test.js +++ b/test/selfhost-ec2-create-test.js @@ -219,11 +219,16 @@ describe('Selfhost EC2 Cloudron creation', function () { cloudron.checkMail(owner, done); }); - it('can delete the cloudron', function (done) { + after(function (done) { + console.log('Cleanup EC2 instances'); + var params = { InstanceIds: [ instanceId, newInstanceId ] }; - ec2.terminateInstances(params, done); + ec2.terminateInstances(params, function (error) { + if (error) console.log(error); + done(); + }); }); });