From be78b9a03d526e36f2395b04807d7dec41031a61 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Wed, 31 Mar 2021 22:42:56 +0200 Subject: [PATCH] E2ETests: Use recursive for 'uploads/' deletion. This ensures the folder is always deleted, even if there are still files (from previous broken tests) in it. Signed-off-by: Philip Molares --- test/private-api/notes.e2e-spec.ts | 2 +- test/public-api/me.e2e-spec.ts | 2 +- test/public-api/notes.e2e-spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/private-api/notes.e2e-spec.ts b/test/private-api/notes.e2e-spec.ts index 7e5806755..1e68c0d30 100644 --- a/test/private-api/notes.e2e-spec.ts +++ b/test/private-api/notes.e2e-spec.ts @@ -256,7 +256,7 @@ describe('Notes', () => { // delete the file afterwards await fs.unlink(join(uploadPath, fileName)); } - await fs.rmdir(uploadPath); + await fs.rmdir(uploadPath, { recursive: true }); }); it('fails, when note does not exist', async () => { await request(app.getHttpServer()) diff --git a/test/public-api/me.e2e-spec.ts b/test/public-api/me.e2e-spec.ts index 5b13f4b52..76a3161c9 100644 --- a/test/public-api/me.e2e-spec.ts +++ b/test/public-api/me.e2e-spec.ts @@ -270,7 +270,7 @@ describe('Me', () => { // delete the file afterwards await fs.unlink(join(uploadPath, fileName)); } - await fs.rmdir(uploadPath); + await fs.rmdir(uploadPath, { recursive: true }); }); afterAll(async () => { diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index b86d187fd..b7f2e2e2c 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -362,7 +362,7 @@ describe('Notes', () => { // delete the file afterwards await fs.unlink(join(uploadPath, fileName)); } - await fs.rmdir(uploadPath); + await fs.rmdir(uploadPath, { recursive: true }); }); it('fails, when note does not exist', async () => { await request(app.getHttpServer())