@@ -63,46 +63,46 @@ assert.strictEqual(typeof fs.R_OK, 'number'); |
63 | 63 | assert.strictEqual(typeof fs.W_OK, 'number'); |
64 | 64 | assert.strictEqual(typeof fs.X_OK, 'number'); |
65 | 65 |
|
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 | +})); |
69 | 69 |
|
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 | +})); |
73 | 73 |
|
74 | | -fs.access(doesNotExist, function(err) { |
| 74 | +fs.access(doesNotExist, common.mustCall((err) => { |
75 | 75 | assert.notEqual(err, null, 'error should exist'); |
76 | 76 | assert.strictEqual(err.code, 'ENOENT'); |
77 | 77 | assert.strictEqual(err.path, doesNotExist); |
78 | | -}); |
| 78 | +})); |
79 | 79 |
|
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 | +})); |
83 | 83 |
|
84 | | -fs.access(readOnlyFile, fs.W_OK, function(err) { |
| 84 | +fs.access(readOnlyFile, fs.W_OK, common.mustCall((err) => { |
85 | 85 | if (hasWriteAccessForReadonlyFile) { |
86 | | - assert.equal(err, null, 'error should not exist'); |
| 86 | + assert.ifError(err); |
87 | 87 | } else { |
88 | 88 | assert.notEqual(err, null, 'error should exist'); |
89 | 89 | assert.strictEqual(err.path, readOnlyFile); |
90 | 90 | } |
91 | | -}); |
| 91 | +})); |
92 | 92 |
|
93 | | -assert.throws(function() { |
94 | | - fs.access(100, fs.F_OK, function(err) {}); |
| 93 | +assert.throws(() => { |
| 94 | + fs.access(100, fs.F_OK, (err) => {}); |
95 | 95 | }, /path must be a string or Buffer/); |
96 | 96 |
|
97 | | -assert.throws(function() { |
| 97 | +assert.throws(() => { |
98 | 98 | fs.access(__filename, fs.F_OK); |
99 | 99 | }, /"callback" argument must be a function/); |
100 | 100 |
|
101 | | -assert.throws(function() { |
| 101 | +assert.throws(() => { |
102 | 102 | fs.access(__filename, fs.F_OK, {}); |
103 | 103 | }, /"callback" argument must be a function/); |
104 | 104 |
|
105 | | -assert.doesNotThrow(function() { |
| 105 | +assert.doesNotThrow(() => { |
106 | 106 | fs.accessSync(__filename); |
107 | 107 | }); |
108 | 108 |
|
@@ -112,13 +112,13 @@ assert.doesNotThrow(function() { |
112 | 112 | fs.accessSync(readWriteFile, mode); |
113 | 113 | }); |
114 | 114 |
|
115 | | -assert.throws(function() { |
| 115 | +assert.throws(() => { |
116 | 116 | fs.accessSync(doesNotExist); |
117 | | -}, function(err) { |
| 117 | +}, (err) => { |
118 | 118 | return err.code === 'ENOENT' && err.path === doesNotExist; |
119 | 119 | }); |
120 | 120 |
|
121 | | -process.on('exit', function() { |
| 121 | +process.on('exit', () => { |
122 | 122 | removeFile(readOnlyFile); |
123 | 123 | removeFile(readWriteFile); |
124 | 124 | }); |