aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tmp/test/graceful-sync.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tmp/test/graceful-sync.js')
-rw-r--r--node_modules/tmp/test/graceful-sync.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/tmp/test/graceful-sync.js b/node_modules/tmp/test/graceful-sync.js
new file mode 100644
index 000000000..37766ffa6
--- /dev/null
+++ b/node_modules/tmp/test/graceful-sync.js
@@ -0,0 +1,20 @@
+var
+ tmp = require('../lib/tmp'),
+ spawn = require('./spawn-sync');
+
+var graceful = spawn.arg;
+
+if (graceful) {
+ tmp.setGracefulCleanup();
+}
+
+try {
+ var result = spawn.tmpFunction();
+ spawn.out(result.name, function () {
+ throw new Error('Thrown on purpose');
+ });
+}
+catch (e) {
+ spawn.err(e, spawn.exit);
+}
+