| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c0aec67 commit 5e3f751
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,19 +185,19 @@ function removeAsync(dir) { | |||
| 185 | 185 | makeNonEmptyDirectory(4, 10, 2, dir, true); | |
| 186 | 186 | ||
| 187 | 187 | // Removal should fail without the recursive option set to true. | |
| 188 | - assert.rejects(fs.promises.rm(dir), { syscall: 'rm' }); | ||
| 189 | - assert.rejects(fs.promises.rm(dir, { recursive: false }), { | ||
| 188 | + await assert.rejects(fs.promises.rm(dir), { syscall: 'rm' }); | ||
| 189 | + await assert.rejects(fs.promises.rm(dir, { recursive: false }), { | ||
| 190 | 190 | syscall: 'rm' | |
| 191 | 191 | }); | |
| 192 | 192 | ||
| 193 | 193 | // Recursive removal should succeed. | |
| 194 | 194 | await fs.promises.rm(dir, { recursive: true }); | |
| 195 | 195 | ||
| 196 | 196 | // Attempted removal should fail now because the directory is gone. | |
| 197 | - assert.rejects(fs.promises.rm(dir), { syscall: 'stat' }); | ||
| 197 | + await assert.rejects(fs.promises.rm(dir), { syscall: 'stat' }); | ||
| 198 | 198 | ||
| 199 | 199 | // Should fail if target does not exist | |
| 200 | - assert.rejects(fs.promises.rm( | ||
| 200 | + await assert.rejects(fs.promises.rm( | ||
| 201 | 201 | path.join(tmpdir.path, 'noexist.txt'), | |
| 202 | 202 | { recursive: true } | |
| 203 | 203 | ), { | |
@@ -207,7 +207,7 @@ function removeAsync(dir) { | |||
| 207 | 207 | }); | |
| 208 | 208 | ||
| 209 | 209 | // Should not fail if target does not exist and force option is true | |
| 210 | - fs.promises.rm(path.join(tmpdir.path, 'noexist.txt'), { force: true }); | ||
| 210 | + await fs.promises.rm(path.join(tmpdir.path, 'noexist.txt'), { force: true }); | ||
| 211 | 211 | ||
| 212 | 212 | // Should delete file | |
| 213 | 213 | const filePath = path.join(tmpdir.path, 'rm-promises-file.txt'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -141,8 +141,8 @@ function removeAsync(dir) { | |||
| 141 | 141 | makeNonEmptyDirectory(4, 10, 2, dir, true); | |
| 142 | 142 | ||
| 143 | 143 | // Removal should fail without the recursive option set to true. | |
| 144 | - assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); | ||
| 145 | - assert.rejects(fs.promises.rmdir(dir, { recursive: false }), { | ||
| 144 | + await assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); | ||
| 145 | + await assert.rejects(fs.promises.rmdir(dir, { recursive: false }), { | ||
| 146 | 146 | syscall: 'rmdir' | |
| 147 | 147 | }); | |
| 148 | 148 | ||
@@ -154,7 +154,7 @@ function removeAsync(dir) { | |||
| 154 | 154 | { code: 'ENOENT' }); | |
| 155 | 155 | ||
| 156 | 156 | // Attempted removal should fail now because the directory is gone. | |
| 157 | - assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); | ||
| 157 | + await assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); | ||
| 158 | 158 | })().then(common.mustCall()); | |
| 159 | 159 | ||
| 160 | 160 | // Test input validation. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments