File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,11 @@ var assert = require('assert');
5
5
var fs = require ( 'fs' ) ;
6
6
var path = require ( 'path' ) ;
7
7
8
- var f = path . join ( common . fixturesDir , 'x.txt' ) ;
8
+ const f = path . join ( common . fixturesDir , 'x.txt' ) ;
9
9
10
- console . log ( 'watching for changes of ' + f ) ;
11
-
12
- var changes = 0 ;
10
+ let changes = 0 ;
13
11
function watchFile ( ) {
14
- fs . watchFile ( f , function ( curr , prev ) {
15
- console . log ( f + ' change' ) ;
12
+ fs . watchFile ( f , ( curr , prev ) => {
16
13
changes ++ ;
17
14
assert . notDeepStrictEqual ( curr . mtime , prev . mtime ) ;
18
15
fs . unwatchFile ( f ) ;
@@ -24,7 +21,7 @@ function watchFile() {
24
21
watchFile ( ) ;
25
22
26
23
27
- var fd = fs . openSync ( f , 'w+' ) ;
24
+ const fd = fs . openSync ( f , 'w+' ) ;
28
25
fs . writeSync ( fd , 'xyz\n' ) ;
29
26
fs . closeSync ( fd ) ;
30
27
You can’t perform that action at this time.
0 commit comments