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');
55var fs = require ( 'fs' ) ;
66var path = require ( 'path' ) ;
77
8- var f = path . join ( common . fixturesDir , 'x.txt' ) ;
8+ const f = path . join ( common . fixturesDir , 'x.txt' ) ;
99
10- console . log ( 'watching for changes of ' + f ) ;
11-
12- var changes = 0 ;
10+ let changes = 0 ;
1311function watchFile ( ) {
14- fs . watchFile ( f , function ( curr , prev ) {
15- console . log ( f + ' change' ) ;
12+ fs . watchFile ( f , ( curr , prev ) => {
1613 changes ++ ;
1714 assert . notDeepStrictEqual ( curr . mtime , prev . mtime ) ;
1815 fs . unwatchFile ( f ) ;
@@ -24,7 +21,7 @@ function watchFile() {
2421watchFile ( ) ;
2522
2623
27- var fd = fs . openSync ( f , 'w+' ) ;
24+ const fd = fs . openSync ( f , 'w+' ) ;
2825fs . writeSync ( fd , 'xyz\n' ) ;
2926fs . closeSync ( fd ) ;
3027
You can’t perform that action at this time.
0 commit comments