Skip to content

Commit

Permalink
fix tests, remove obsolete tests, add missing SIGINT handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Feb 3, 2020
1 parent 05d1b43 commit 78c72ef
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 172 deletions.
1 change: 0 additions & 1 deletion lib/tmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCall
* @private
*/
function _garbageCollector() {
console.log(_gracefulCleanup);
/* istanbul ignore else */
if (!_gracefulCleanup) return;

Expand Down
27 changes: 0 additions & 27 deletions test/issue129-sigint-test.js

This file was deleted.

30 changes: 0 additions & 30 deletions test/issue129-test.js

This file was deleted.

1 change: 1 addition & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--file ./test/setup-sigint-listener.js
4 changes: 4 additions & 0 deletions test/outband/issue121.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

const tmp = require('../../lib/tmp');

process.on('SIGINT', function () {
process.exit(0);
});

process.on('SIGTERM', function () {
process.exit(0);
});
Expand Down
32 changes: 0 additions & 32 deletions test/outband/issue129-sigint.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/outband/issue129-sigint.json

This file was deleted.

76 changes: 0 additions & 76 deletions test/outband/issue129.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/outband/issue129.json

This file was deleted.

2 changes: 2 additions & 0 deletions test/setup-sigint-listener.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// make sure that all garbage gets collected on SIGINT
process.on('SIGINT', process.exit);
4 changes: 4 additions & 0 deletions test/spawn-generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ var fnUnderTest = null;
if (config.async) fnUnderTest = (config.file) ? tmp.file : tmp.dir;
else fnUnderTest = (config.file) ? tmp.fileSync : tmp.dirSync;

// make sure that we have a SIGINT handler so CTRL-C the test suite
// will not leave anything behing
process.on('SIGINT', process.exit);

// do we test against tmp doing a graceful cleanup?
if (config.graceful) tmp.setGracefulCleanup();

Expand Down

0 comments on commit 78c72ef

Please sign in to comment.