try rmSync

This commit is contained in:
Cory Miller
2023-02-23 17:26:31 +00:00
parent 91f0c9b7d0
commit 665b756702
3 changed files with 18 additions and 14 deletions

View File

@@ -345,18 +345,18 @@ describe('rmRF', () => {
const fd = await fs.open(filePath, 'r')
// can't remove folder with locked file on windows
if (ioUtil.IS_WINDOWS) {
try {
// additionally, can't stat an open file on Windows without getting EPERM
await io.rmRF(testPath)
} catch (err) {
expect(err.code).toBe('EPERM')
}
} else {
await io.rmRF(testPath)
await assertNotExists(testPath)
}
// // can't remove folder with locked file on windows
// if (ioUtil.IS_WINDOWS) {
// try {
// // additionally, can't stat an open file on Windows without getting EPERM
// await io.rmRF(testPath)
// } catch (err) {
// expect(err.code).toBe('EPERM')
// }
// } else {
await io.rmRF(testPath)
await assertNotExists(testPath)
// }
await fd.close()
await io.rmRF(testPath)