@@ -63,46 +63,46 @@ assert.strictEqual(typeof fs.R_OK, 'number');
6363assert . strictEqual ( typeof fs . W_OK , 'number' ) ;
6464assert . strictEqual ( typeof fs . X_OK , 'number' ) ;
6565
66- fs . access ( __filename , function ( err ) {
67- assert . strictEqual ( err , null , 'error should not exist' ) ;
68- } ) ;
66+ fs . access ( __filename , common . mustCall ( ( err ) => {
67+ assert . ifError ( err ) ;
68+ } ) ) ;
6969
70- fs . access ( __filename , fs . R_OK , function ( err ) {
71- assert . strictEqual ( err , null , 'error should not exist' ) ;
72- } ) ;
70+ fs . access ( __filename , fs . R_OK , common . mustCall ( ( err ) => {
71+ assert . ifError ( err ) ;
72+ } ) ) ;
7373
74- fs . access ( doesNotExist , function ( err ) {
74+ fs . access ( doesNotExist , common . mustCall ( ( err ) => {
7575 assert . notEqual ( err , null , 'error should exist' ) ;
7676 assert . strictEqual ( err . code , 'ENOENT' ) ;
7777 assert . strictEqual ( err . path , doesNotExist ) ;
78- } ) ;
78+ } ) ) ;
7979
80- fs . access ( readOnlyFile , fs . F_OK | fs . R_OK , function ( err ) {
81- assert . strictEqual ( err , null , 'error should not exist' ) ;
82- } ) ;
80+ fs . access ( readOnlyFile , fs . F_OK | fs . R_OK , common . mustCall ( ( err ) => {
81+ assert . ifError ( err ) ;
82+ } ) ) ;
8383
84- fs . access ( readOnlyFile , fs . W_OK , function ( err ) {
84+ fs . access ( readOnlyFile , fs . W_OK , common . mustCall ( ( err ) => {
8585 if ( hasWriteAccessForReadonlyFile ) {
86- assert . equal ( err , null , 'error should not exist' ) ;
86+ assert . ifError ( err ) ;
8787 } else {
8888 assert . notEqual ( err , null , 'error should exist' ) ;
8989 assert . strictEqual ( err . path , readOnlyFile ) ;
9090 }
91- } ) ;
91+ } ) ) ;
9292
93- assert . throws ( function ( ) {
94- fs . access ( 100 , fs . F_OK , function ( err ) { } ) ;
93+ assert . throws ( ( ) => {
94+ fs . access ( 100 , fs . F_OK , ( err ) => { } ) ;
9595} , / p a t h m u s t b e a s t r i n g o r B u f f e r / ) ;
9696
97- assert . throws ( function ( ) {
97+ assert . throws ( ( ) => {
9898 fs . access ( __filename , fs . F_OK ) ;
9999} , / " c a l l b a c k " a r g u m e n t m u s t b e a f u n c t i o n / ) ;
100100
101- assert . throws ( function ( ) {
101+ assert . throws ( ( ) => {
102102 fs . access ( __filename , fs . F_OK , { } ) ;
103103} , / " c a l l b a c k " a r g u m e n t m u s t b e a f u n c t i o n / ) ;
104104
105- assert . doesNotThrow ( function ( ) {
105+ assert . doesNotThrow ( ( ) => {
106106 fs . accessSync ( __filename ) ;
107107} ) ;
108108
@@ -112,13 +112,13 @@ assert.doesNotThrow(function() {
112112 fs . accessSync ( readWriteFile , mode ) ;
113113} ) ;
114114
115- assert . throws ( function ( ) {
115+ assert . throws ( ( ) => {
116116 fs . accessSync ( doesNotExist ) ;
117- } , function ( err ) {
117+ } , ( err ) => {
118118 return err . code === 'ENOENT' && err . path === doesNotExist ;
119119} ) ;
120120
121- process . on ( 'exit' , function ( ) {
121+ process . on ( 'exit' , ( ) => {
122122 removeFile ( readOnlyFile ) ;
123123 removeFile ( readWriteFile ) ;
124124} ) ;
0 commit comments