We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ba2cf9 commit 17d9a73Copy full SHA for 17d9a73
test/pummel/test-watch-file.js
@@ -5,14 +5,11 @@ var assert = require('assert');
5
var fs = require('fs');
6
var path = require('path');
7
8
-var f = path.join(common.fixturesDir, 'x.txt');
+const f = path.join(common.fixturesDir, 'x.txt');
9
10
-console.log('watching for changes of ' + f);
11
-
12
-var changes = 0;
+let changes = 0;
13
function watchFile() {
14
- fs.watchFile(f, function(curr, prev) {
15
- console.log(f + ' change');
+ fs.watchFile(f, (curr, prev) => {
16
changes++;
17
assert.notDeepStrictEqual(curr.mtime, prev.mtime);
18
fs.unwatchFile(f);
@@ -24,7 +21,7 @@ function watchFile() {
24
21
watchFile();
25
22
26
23
27
-var fd = fs.openSync(f, 'w+');
+const fd = fs.openSync(f, 'w+');
28
fs.writeSync(fd, 'xyz\n');
29
fs.closeSync(fd);
30
0 commit comments