@@ -57,10 +57,10 @@ assert.doesNotThrow(
57
57
function ( ) {
58
58
const watcher = fs . watch ( filepathOne ) ;
59
59
watcher . on ( 'change' , function ( event , filename ) {
60
- assert . strictEqual ( 'change' , event ) ;
60
+ assert . strictEqual ( event , 'change' ) ;
61
61
62
62
if ( expectFilePath ) {
63
- assert . strictEqual ( 'watch.txt' , filename ) ;
63
+ assert . strictEqual ( filename , 'watch.txt' ) ;
64
64
}
65
65
watcher . close ( ) ;
66
66
++ watchSeenOne ;
@@ -80,10 +80,10 @@ fs.writeFileSync(filepathTwoAbs, 'howdy');
80
80
assert . doesNotThrow (
81
81
function ( ) {
82
82
const watcher = fs . watch ( filepathTwo , function ( event , filename ) {
83
- assert . strictEqual ( 'change' , event ) ;
83
+ assert . strictEqual ( event , 'change' ) ;
84
84
85
85
if ( expectFilePath ) {
86
- assert . strictEqual ( 'hasOwnProperty' , filename ) ;
86
+ assert . strictEqual ( filename , 'hasOwnProperty' ) ;
87
87
}
88
88
watcher . close ( ) ;
89
89
++ watchSeenTwo ;
@@ -103,11 +103,11 @@ assert.doesNotThrow(
103
103
function ( ) {
104
104
const watcher = fs . watch ( testsubdir , function ( event , filename ) {
105
105
const renameEv = common . isSunOS || common . isAix ? 'change' : 'rename' ;
106
- assert . strictEqual ( renameEv , event ) ;
106
+ assert . strictEqual ( event , renameEv ) ;
107
107
if ( expectFilePath ) {
108
- assert . strictEqual ( 'newfile.txt' , filename ) ;
108
+ assert . strictEqual ( filename , 'newfile.txt' ) ;
109
109
} else {
110
- assert . strictEqual ( null , filename ) ;
110
+ assert . strictEqual ( filename , null ) ;
111
111
}
112
112
watcher . close ( ) ;
113
113
++ watchSeenThree ;
@@ -134,13 +134,13 @@ assert.throws(function() {
134
134
oldhandle = w . _handle ;
135
135
w . _handle = { close : w . _handle . close } ;
136
136
w . close ( ) ;
137
- } , TypeError ) ;
137
+ } , / ^ T y p e E r r o r : I l l e g a l i n v o c a t i o n $ / ) ;
138
138
oldhandle . close ( ) ; // clean up
139
139
140
140
assert . throws ( function ( ) {
141
141
const w = fs . watchFile ( __filename , { persistent : false } , common . noop ) ;
142
142
oldhandle = w . _handle ;
143
143
w . _handle = { stop : w . _handle . stop } ;
144
144
w . stop ( ) ;
145
- } , TypeError ) ;
145
+ } , / ^ T y p e E r r o r : I l l e g a l i n v o c a t i o n $ / ) ;
146
146
oldhandle . stop ( ) ; // clean up
0 commit comments