Skip to content

Instantly share code, notes, and snippets.

@mkhl
Last active March 31, 2016 17:27
Show Gist options
  • Save mkhl/e4b299efb7777104a816a4f313438025 to your computer and use it in GitHub Desktop.
Save mkhl/e4b299efb7777104a816a4f313438025 to your computer and use it in GitHub Desktop.
From d3180baace023233e9fff2d049bcd7beb143f853 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20K=C3=BChl?= <martin.kuehl@innoq.com>
Date: Thu, 31 Mar 2016 19:20:00 +0200
Subject: [PATCH] Test operation with path inside `$TMPDIR`
---
js/spec/index-spec.js | 3 ++-
package.json | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/js/spec/index-spec.js b/js/spec/index-spec.js
index 5018db3..973e5f8 100644
--- a/js/spec/index-spec.js
+++ b/js/spec/index-spec.js
@@ -6,6 +6,7 @@ const exec = promisify((command, options, callback) =>
require('child_process').exec(command, options, callback));
const segfaultHandler = require('segfault-handler');
segfaultHandler.registerHandler();
+const temp = require('temp').track();
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;
@@ -13,7 +14,7 @@ const DEBOUNCE = 1000;
const TIMEOUT_PER_STEP = 3000;
describe('Node Sentinel File Watcher', function() {
- const workDir = path.resolve('./mockfs');
+ const workDir = temp.mkdir('mockfs');
beforeEach(function(done) {
function makeDir(identifier) {
diff --git a/package.json b/package.json
index c36c0c4..3f9d691 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,8 @@
"babel-preset-es2015": "^6.5.0",
"eslint": "^2.2.0",
"jasmine-node": "^2.0.0",
- "segfault-handler": "^1.0.0"
+ "segfault-handler": "^1.0.0",
+ "temp": "^0.8.3"
},
"keywords": [
"FileWatcher",
--
2.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment