From 6de7196feb4aefaf7e36261d086f1b3a8fe86146 Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Mon, 27 Jan 2020 21:05:02 +0100 Subject: [PATCH] fix #211: existing tests must clean up after themselves --- test/dir-test.js | 8 ++++---- test/file-test.js | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/dir-test.js b/test/dir-test.js index ed45da1..8719d8a 100644 --- a/test/dir-test.js +++ b/test/dir-test.js @@ -63,7 +63,7 @@ describe('tmp', function () { try { assertions.assertDoesNotExist(stdout); } catch (err) { - rimraf.sync(stdout); + //rimraf.sync(stdout); return done(err); } done(); @@ -76,8 +76,8 @@ describe('tmp', function () { if (!stderr) return done(new Error('stderr expected')); try { assertions.assertExists(stdout); - } catch (err) { rimraf.sync(stdout); + } catch (err) { return done(err); } done(); @@ -90,8 +90,8 @@ describe('tmp', function () { if (stderr) return done(new Error(stderr)); try { assertions.assertExists(stdout); - } catch (err) { rimraf.sync(stdout); + } catch (err) { return done(err); } done(); @@ -137,8 +137,8 @@ describe('tmp', function () { assertions.assertExists(path.join(stdout, 'symlinkme-target'), true); else assertions.assertExists(path.join(stdout, 'symlinkme-target')); - } catch (err) { rimraf.sync(stdout); + } catch (err) { return done(err); } done(); diff --git a/test/file-test.js b/test/file-test.js index c8d6e7d..7142f63 100644 --- a/test/file-test.js +++ b/test/file-test.js @@ -86,8 +86,8 @@ describe('tmp', function () { if (!stderr) return done(new Error('stderr expected')); try { assertions.assertExists(stdout, true); - } catch (err) { rimraf.sync(stdout); + } catch (err) { return done(err); } done(); @@ -100,8 +100,8 @@ describe('tmp', function () { if (stderr) return done(new Error(stderr)); try { assertions.assertExists(stdout, true); - } catch (err) { rimraf.sync(stdout); + } catch (err) { return done(err); } done(); @@ -139,5 +139,4 @@ describe('tmp', function () { }); }); }); -}); - +}); \ No newline at end of file