Skip to content

Commit

Permalink
test/helpers: Replace deprecated recursive rmdir (#2255)
Browse files Browse the repository at this point in the history
Recursive `fs.rmdir` calls have been deprecated in favor of recursive
calls to `fs.rm` and the deprecation warning is seen as an error by
AppVeyor thus failing the scenarios job.

Replacing these calls should get us a green CI again.
  • Loading branch information
taratatach authored Jul 29, 2022
1 parent 4d69e5f commit 8928511
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/support/helpers/context_dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class ContextDir {
}

async rmdir(target /*: string | {path: string} */) {
await fse.rmdirSync(this.abspath(target))
await fse.rm(this.abspath(target), { recursive: true })
}

async readFile(
Expand Down
4 changes: 2 additions & 2 deletions test/support/helpers/scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const merge = async (srcPath, dstPath) => {
await fse.rename(srcPath, dstPath)
} else if (srcStats && srcStats.isFile()) {
debug('file is replacing dir', { srcPath, dstPath })
await fse.rmdir(dstPath, { recursive: true })
await fse.rm(dstPath, { recursive: true })
await fse.rename(srcPath, dstPath)
} else {
for (const entry of await fse.readdir(srcPath)) {
Expand All @@ -333,7 +333,7 @@ const merge = async (srcPath, dstPath) => {
}
if (srcStats && srcStats.isDirectory()) {
try {
await fse.rmdir(srcPath, { recursive: true })
await fse.rm(srcPath, { recursive: true })
} catch (err) {
debug('rmdir', { path: srcPath }, err)
}
Expand Down

0 comments on commit 8928511

Please sign in to comment.