test: ensure testSetup.cleanup is called

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-03-04 13:13:46 +01:00
parent f0e6f6150d
commit a6734cc58f
14 changed files with 55 additions and 28 deletions

View file

@ -53,6 +53,13 @@ describe('Media', () => {
.expect(201);
});
afterAll(async () => {
// Delete the upload folder
await ensureDeleted(uploadPath);
await testSetup.app.close();
await testSetup.cleanup();
});
describe('POST /media', () => {
it('works', async () => {
const uploadResponse = await agent
@ -122,10 +129,4 @@ describe('Media', () => {
const filename = url.split('/').pop() || '';
await agent.delete('/api/private/media/' + filename).expect(204);
});
afterAll(async () => {
// Delete the upload folder
await ensureDeleted(uploadPath);
await testSetup.app.close();
});
});