test: Require with empty cache

This commit is contained in:
Felix Rieseberg 2024-10-08 10:49:03 -04:00
parent e25ec9e836
commit 3f80e318cd
5 changed files with 8 additions and 8 deletions

View file

@ -9,13 +9,13 @@ promises.rm = promises.rm || async function (...args) {
const options = args[1] || {}
try {
const stat = await fs.stat(pathToRemove, { throwIfNoEntry: false })
const stat = await promises.stat(pathToRemove, { throwIfNoEntry: false })
const isDirectory = stat.isDirectory()
if (isDirectory) {
await fs.rmdir(pathToRemove, options)
await promises.rmdir(pathToRemove, options)
} else {
await fs.unlink(pathToRemove)
await promises.unlink(pathToRemove)
}
} catch (err) {
if (err.code === 'ENOENT' && options.force) {