diff --git a/packages/io/__tests__/io.test.ts b/packages/io/__tests__/io.test.ts index 33873054..1ce42295 100644 --- a/packages/io/__tests__/io.test.ts +++ b/packages/io/__tests__/io.test.ts @@ -344,12 +344,15 @@ describe('rmRF', () => { await assertExists(filePath) const fd = await fs.open(filePath, 'r') - await io.rmRF(testPath) // can't remove folder with locked file on windows if (ioUtil.IS_WINDOWS) { - // additionally, can't stat an open file on Windows without getting EPERM - await ioUtil.access(filePath) + 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 assertNotExists(testPath) } diff --git a/packages/io/src/io.ts b/packages/io/src/io.ts index d350871a..3d7a0f53 100644 --- a/packages/io/src/io.ts +++ b/packages/io/src/io.ts @@ -136,7 +136,6 @@ export async function rmRF(inputPath: string): Promise { } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid - console.log(err) if (err.code !== 'ENOENT') throw err }