summaryrefslogtreecommitdiff
path: root/test/sequential/test-regress-GH-4027.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/sequential/test-regress-GH-4027.js')
-rw-r--r--test/sequential/test-regress-GH-4027.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/test/sequential/test-regress-GH-4027.js b/test/sequential/test-regress-GH-4027.js
index 80780fd6a2..aa1ec12c30 100644
--- a/test/sequential/test-regress-GH-4027.js
+++ b/test/sequential/test-regress-GH-4027.js
@@ -10,14 +10,8 @@ var filename = path.join(common.tmpDir, 'watched');
fs.writeFileSync(filename, 'quis custodiet ipsos custodes');
setTimeout(fs.unlinkSync, 100, filename);
-var seenEvent = 0;
-process.on('exit', function() {
- assert.equal(seenEvent, 1);
-});
-
-fs.watchFile(filename, { interval: 50 }, function(curr, prev) {
+fs.watchFile(filename, { interval: 50 }, common.mustCall(function(curr, prev) {
assert.equal(prev.nlink, 1);
assert.equal(curr.nlink, 0);
fs.unwatchFile(filename);
- seenEvent++;
-});
+}));