Browse Source

test: fix assertion in test-watch-file.js

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 <fishrock123@rocketmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Evan Lucas
parent
commit
9a393a7ff4
  1. 2
      test/pummel/test-watch-file.js

2
test/pummel/test-watch-file.js

@ -14,7 +14,7 @@ function watchFile() {
fs.watchFile(f, function(curr, prev) { fs.watchFile(f, function(curr, prev) {
console.log(f + ' change'); console.log(f + ' change');
changes++; changes++;
assert.ok(curr.mtime != prev.mtime); assert.notDeepStrictEqual(curr.mtime, prev.mtime);
fs.unwatchFile(f); fs.unwatchFile(f);
watchFile(); watchFile();
fs.unwatchFile(f); fs.unwatchFile(f);

Loading…
Cancel
Save