@@ -26,9 +26,9 @@ const executableFile =
2626 GLib . get_current_dir ( ) + "/__tests__/polyfills/fs/files/executable" ;
2727
2828const mustCall = <
29- F extends ( ...args : any [ ] ) => any = ( err ?: any , ...args : any [ ] ) => void
29+ F extends ( ...args : any [ ] ) => any = ( err ?: any , ...args : any [ ] ) => void ,
3030> (
31- run : ( cb : F ) => any
31+ run : ( cb : F ) => any ,
3232) => {
3333 return new Promise < FunctionMock < F > > ( ( resolve , reject ) => {
3434 const t = setTimeout ( ( ) => {
@@ -79,7 +79,7 @@ export default describe("fs.access", () => {
7979 expect ( mock1 ) . toHaveBeenCalledWithLast ( null ) ;
8080
8181 const mock2 = await mustCall ( ( cb ) =>
82- fs . access ( thisFile , fs . constants . R_OK , cb )
82+ fs . access ( thisFile , fs . constants . R_OK , cb ) ,
8383 ) ;
8484 expect ( mock2 ) . toHaveBeenCalledWithLast ( null ) ;
8585 } ) ;
@@ -89,7 +89,7 @@ export default describe("fs.access", () => {
8989 expect ( mock1 ) . toHaveBeenCalledWithLast ( null ) ;
9090
9191 const mock2 = await mustCall ( ( cb ) =>
92- fs . access ( readOnlyFile , fs . constants . W_OK , cb )
92+ fs . access ( readOnlyFile , fs . constants . W_OK , cb ) ,
9393 ) ;
9494 expect ( mock2 ) . toHaveBeenCalledWithLast ( match . instanceOf ( Error ) ) ;
9595 } ) ;
@@ -99,13 +99,13 @@ export default describe("fs.access", () => {
9999 expect ( mock1 ) . toHaveBeenCalledWithLast ( null ) ;
100100
101101 const mock2 = await mustCall ( ( cb ) =>
102- fs . access ( nonReadableFile , fs . constants . R_OK , cb )
102+ fs . access ( nonReadableFile , fs . constants . R_OK , cb ) ,
103103 ) ;
104104 expect ( mock2 ) . toHaveBeenCalledWithLast (
105105 match . allOf ( match . instanceOf ( Error ) , {
106106 code : "EACCES" ,
107107 path : nonReadableFile ,
108- } )
108+ } ) ,
109109 ) ;
110110 } ) ;
111111
@@ -115,25 +115,25 @@ export default describe("fs.access", () => {
115115 match . allOf ( match . instanceOf ( Error ) , {
116116 code : "ENOENT" ,
117117 path : nonExistentFile ,
118- } )
118+ } ) ,
119119 ) ;
120120 } ) ;
121121
122122 it ( "should correctly report access to a non-executable file" , async ( ) => {
123123 const mock = await mustCall ( ( cb ) =>
124- fs . access ( thisFile , fs . constants . X_OK , cb )
124+ fs . access ( thisFile , fs . constants . X_OK , cb ) ,
125125 ) ;
126126 expect ( mock ) . toHaveBeenCalledWithLast (
127127 match . allOf ( match . instanceOf ( Error ) , {
128128 code : "EACCES" ,
129129 path : thisFile ,
130- } )
130+ } ) ,
131131 ) ;
132132 } ) ;
133133
134134 it ( "should correctly report access to an executable file" , async ( ) => {
135135 const mock = await mustCall ( ( cb ) =>
136- fs . access ( executableFile , fs . constants . X_OK , cb )
136+ fs . access ( executableFile , fs . constants . X_OK , cb ) ,
137137 ) ;
138138 expect ( mock ) . toHaveBeenCalledWithLast ( null ) ;
139139 } ) ;
@@ -143,14 +143,14 @@ export default describe("fs.access", () => {
143143 expect ( ( ) => fs . access ( thisFile ) ) . toThrowMatch (
144144 match . allOf ( match . instanceOf ( TypeError ) , {
145145 code : "ERR_INVALID_ARG_TYPE" ,
146- } )
146+ } ) ,
147147 ) ;
148148
149149 // @ts -expect-error
150150 expect ( ( ) => fs . access ( thisFile , fs . constants . R_OK ) ) . toThrowMatch (
151151 match . allOf ( match . instanceOf ( TypeError ) , {
152152 code : "ERR_INVALID_ARG_TYPE" ,
153- } )
153+ } ) ,
154154 ) ;
155155 } ) ;
156156 } ) ;
@@ -171,7 +171,7 @@ export default describe("fs.access", () => {
171171 expect ( result1 ) . toBe ( undefined ) ;
172172
173173 expect ( ( ) => fs . accessSync ( readOnlyFile , fs . constants . W_OK ) ) . toThrowMatch (
174- match . instanceOf ( Error )
174+ match . instanceOf ( Error ) ,
175175 ) ;
176176 } ) ;
177177
@@ -180,12 +180,12 @@ export default describe("fs.access", () => {
180180 expect ( result1 ) . toBe ( undefined ) ;
181181
182182 expect ( ( ) =>
183- fs . accessSync ( nonReadableFile , fs . constants . R_OK )
183+ fs . accessSync ( nonReadableFile , fs . constants . R_OK ) ,
184184 ) . toThrowMatch (
185185 match . allOf ( match . instanceOf ( Error ) , {
186186 code : "EACCES" ,
187187 path : nonReadableFile ,
188- } )
188+ } ) ,
189189 ) ;
190190 } ) ;
191191
@@ -194,13 +194,13 @@ export default describe("fs.access", () => {
194194 match . allOf ( match . instanceOf ( Error ) , {
195195 code : "ENOENT" ,
196196 path : nonExistentFile ,
197- } )
197+ } ) ,
198198 ) ;
199199 } ) ;
200200
201201 it ( "should correctly report access to a non-executable file" , ( ) => {
202202 expect ( ( ) => fs . accessSync ( thisFile , fs . constants . X_OK ) ) . toThrowMatch (
203- match . instanceOf ( Error )
203+ match . instanceOf ( Error ) ,
204204 ) ;
205205 } ) ;
206206
@@ -226,7 +226,7 @@ export default describe("fs.access", () => {
226226 expect ( result1 ) . toBe ( undefined ) ;
227227
228228 await expect ( fs . access ( readOnlyFile , fs . constants . W_OK ) ) . toRejectMatch (
229- match . instanceOf ( Error )
229+ match . instanceOf ( Error ) ,
230230 ) ;
231231 } ) ;
232232
@@ -238,7 +238,7 @@ export default describe("fs.access", () => {
238238 match . allOf ( match . instanceOf ( Error ) , {
239239 code : "EACCES" ,
240240 path : nonReadableFile ,
241- } )
241+ } ) ,
242242 ) ;
243243 } ) ;
244244
@@ -247,13 +247,13 @@ export default describe("fs.access", () => {
247247 match . allOf ( match . instanceOf ( Error ) , {
248248 code : "ENOENT" ,
249249 path : nonExistentFile ,
250- } )
250+ } ) ,
251251 ) ;
252252 } ) ;
253253
254254 it ( "should correctly report access to a non-executable file" , async ( ) => {
255255 await expect ( fs . access ( thisFile , fs . constants . X_OK ) ) . toRejectMatch (
256- match . instanceOf ( Error )
256+ match . instanceOf ( Error ) ,
257257 ) ;
258258 } ) ;
259259
0 commit comments