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

@ -41,6 +41,11 @@ describe('Notes', () => {
testImage = await fs.readFile('test/public-api/fixtures/test.png');
});
afterAll(async () => {
await testSetup.app.close();
await testSetup.cleanup();
});
it('POST /notes', async () => {
const response = await request(testSetup.app.getHttpServer())
.post('/api/v2/notes')
@ -212,6 +217,7 @@ describe('Notes', () => {
expect(await updatedNote.groupPermissions).toHaveLength(0);
await request(testSetup.app.getHttpServer())
.delete('/api/v2/notes/test3')
.send({ keepMedia: false })
.expect(204);
await expect(
testSetup.notesService.getNoteByIdOrAlias('test3'),
@ -463,8 +469,4 @@ describe('Notes', () => {
.expect(403);
});
});
afterAll(async () => {
await testSetup.app.close();
});
});