GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: add missing await in fs-rm/fs-rmdir tests · nodejs/node@9e7cfbb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-fs-rm.js
    • test-fs-rmdir-recursive.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-fs-rm.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-rm.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,19 @@ function removeAsync(dir) {
184184
makeNonEmptyDirectory(4, 10, 2, dir, true);
185185

186186
// Removal should fail without the recursive option set to true.
187-
assert.rejects(fs.promises.rm(dir), { syscall: 'rm' });
188-
assert.rejects(fs.promises.rm(dir, { recursive: false }), {
187+
await assert.rejects(fs.promises.rm(dir), { syscall: 'rm' });
188+
await assert.rejects(fs.promises.rm(dir, { recursive: false }), {
189189
syscall: 'rm'
190190
});
191191

192192
// Recursive removal should succeed.
193193
await fs.promises.rm(dir, { recursive: true });
194194

195195
// Attempted removal should fail now because the directory is gone.
196-
assert.rejects(fs.promises.rm(dir), { syscall: 'stat' });
196+
await assert.rejects(fs.promises.rm(dir), { syscall: 'stat' });
197197

198198
// Should fail if target does not exist
199-
assert.rejects(fs.promises.rm(
199+
await assert.rejects(fs.promises.rm(
200200
path.join(tmpdir.path, 'noexist.txt'),
201201
{ recursive: true }
202202
), {
@@ -206,7 +206,7 @@ function removeAsync(dir) {
206206
});
207207

208208
// Should not fail if target does not exist and force option is true
209-
fs.promises.rm(path.join(tmpdir.path, 'noexist.txt'), { force: true });
209+
await fs.promises.rm(path.join(tmpdir.path, 'noexist.txt'), { force: true });
210210

211211
// Should delete file
212212
const filePath = path.join(tmpdir.path, 'rm-promises-file.txt');
Collapse file

‎test/parallel/test-fs-rmdir-recursive.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-rmdir-recursive.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ function removeAsync(dir) {
141141
makeNonEmptyDirectory(4, 10, 2, dir, true);
142142

143143
// 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 }), {
146146
syscall: 'rmdir'
147147
});
148148

@@ -154,7 +154,7 @@ function removeAsync(dir) {
154154
{ code: 'ENOENT' });
155155

156156
// 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' });
158158
})().then(common.mustCall());
159159

160160
// Test input validation.

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.