-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf037ec
commit 5283167
Showing
9 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable no-octal */ | ||
// vim: expandtab:ts=2:sw=2 | ||
|
||
const | ||
assert = require('assert'), | ||
assertions = require('./assertions'), | ||
childProcess = require('./child-process').childProcess, | ||
signals = ['SIGINT', 'SIGTERM']; | ||
|
||
describe('tmp', function () { | ||
describe('issue121 - clean up on terminating signals', function () { | ||
for (var i=0; i < signals.length; i++) { | ||
it(signals[i], issue121Tests(signals[i])); | ||
} | ||
}); | ||
}); | ||
|
||
function issue121Tests(signal) { | ||
return function (done) { | ||
childProcess('issue121.json', function (err, stderr, stdout) { | ||
if (err) return done(err); | ||
else if (stderr) return done(new Error(stderr)); | ||
else assertions.assertDoesNotExist(stdout); | ||
done(); | ||
}, true); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable no-octal */ | ||
// vim: expandtab:ts=2:sw=2 | ||
|
||
var | ||
fs = require('fs'), | ||
tmp = require('../../lib/tmp'), | ||
// we reuse the fixtures from issue62 here | ||
fixture = require('./issue62'); | ||
|
||
tmp.setGracefulCleanup(); | ||
|
||
// https://github.com/raszi/node-tmp/issues/121 | ||
module.exports = function (signal) { | ||
fixture.apply(this, [tmp.dirSync({ unsafeCleanup: true }), tmp]); | ||
|
||
// make sure that the process keeps running | ||
setTimeout(function () {}, 1000000); | ||
|
||
this.kill(signal); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"tc": "issue121" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters