From 9a393a7ff4d9efbf4adba9a0bdc86ff2850b1287 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 16 Aug 2016 14:37:08 -0700 Subject: [PATCH] test: fix assertion in test-watch-file.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because it is comparing two Date objects, an assertion in test/pummel/test-watch-file.js would never fire even if the two objects represented the same time. Use `assert.notDeepStrictEqual()` so that the assertion fires if different Date objects represent the same time. PR-URL: https://github.com/nodejs/node/pull/8129 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/pummel/test-watch-file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js index b87711c7a1..8fdf6b32b2 100644 --- a/test/pummel/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -14,7 +14,7 @@ function watchFile() { fs.watchFile(f, function(curr, prev) { console.log(f + ' change'); changes++; - assert.ok(curr.mtime != prev.mtime); + assert.notDeepStrictEqual(curr.mtime, prev.mtime); fs.unwatchFile(f); watchFile(); fs.unwatchFile(f);