mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
test: ensure testSetup.cleanup is called
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
f0e6f6150d
commit
a6734cc58f
14 changed files with 55 additions and 28 deletions
|
@ -28,6 +28,7 @@ describe('Alias', () => {
|
|||
|
||||
afterEach(async () => {
|
||||
await testSetup.app.close();
|
||||
await testSetup.cleanup();
|
||||
});
|
||||
|
||||
describe('POST /alias', () => {
|
||||
|
|
|
@ -31,6 +31,11 @@ describe('Me', () => {
|
|||
await testSetup.app.init();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await testSetup.app.close();
|
||||
await testSetup.cleanup();
|
||||
});
|
||||
|
||||
it(`GET /me`, async () => {
|
||||
const userInfo = testSetup.userService.toFullUserDto(user);
|
||||
const response = await request(testSetup.app.getHttpServer())
|
||||
|
@ -218,8 +223,4 @@ describe('Me', () => {
|
|||
}
|
||||
await fs.rm(uploadPath, { recursive: true });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await testSetup.app.close();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -43,6 +43,13 @@ describe('Media', () => {
|
|||
);
|
||||
});
|
||||
|
||||
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 request(testSetup.app.getHttpServer())
|
||||
|
@ -111,10 +118,4 @@ describe('Media', () => {
|
|||
.delete('/api/v2/media/' + filename)
|
||||
.expect(204);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
// Delete the upload folder
|
||||
await ensureDeleted(uploadPath);
|
||||
await testSetup.app.close();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue