From 165bf211d2f60aa44fb69001b739e3ddb4de7787 Mon Sep 17 00:00:00 2001 From: Mukul Kolpe Date: Thu, 28 Oct 2021 15:00:37 +0530 Subject: [PATCH] fix: stop using fs.rmdirSync (#12292) Co-authored-by: Rhys Arkins --- lib/datasource/crate/index.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datasource/crate/index.spec.ts b/lib/datasource/crate/index.spec.ts index 9da0f5a7e49cab..1e6a0f9b599a1a 100644 --- a/lib/datasource/crate/index.spec.ts +++ b/lib/datasource/crate/index.spec.ts @@ -96,7 +96,7 @@ describe('datasource/crate/index', () => { let adminConfig: RepoGlobalConfig; beforeEach(async () => { - tmpDir = await dir(); + tmpDir = await dir({ unsafeCleanup: true }); adminConfig = { localDir: join(tmpDir.path, 'local'), @@ -108,8 +108,8 @@ describe('datasource/crate/index', () => { memCache.init(); }); - afterEach(() => { - fs.rmdirSync(tmpDir.path, { recursive: true }); + afterEach(async () => { + await tmpDir.cleanup(); tmpDir = null; setGlobalConfig(); });