Skip to content

Commit

Permalink
test: fix assertion in test-watch-file.js
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
Trott authored and Myles Borins committed Oct 10, 2016
1 parent 084d899 commit 96d7ff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/pummel/test-watch-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 96d7ff8

Please sign in to comment.