test: Consistently clean up folder before stopping server

There seems to be some integration tests that sometimes fail
on tests where the order is reversed.
Hopefully this resolves the problem.
This commit is contained in:
Joachim Van Herwegen 2023-10-05 09:46:09 +02:00
parent d618f9781a
commit db66e3df75
4 changed files with 5 additions and 8 deletions

View File

@ -112,8 +112,8 @@ describe('A quota server', (): void => {
}); });
afterAll(async(): Promise<void> => { afterAll(async(): Promise<void> => {
await app.stop();
await removeFolder(rootFilePath); await removeFolder(rootFilePath);
await app.stop();
}); });
// Test quota in the first pod // Test quota in the first pod
@ -198,8 +198,8 @@ describe('A quota server', (): void => {
}); });
afterAll(async(): Promise<void> => { afterAll(async(): Promise<void> => {
await app.stop();
await removeFolder(rootFilePath); await removeFolder(rootFilePath);
await app.stop();
}); });
it('should return 413 when global quota is exceeded.', async(): Promise<void> => { it('should return 413 when global quota is exceeded.', async(): Promise<void> => {

View File

@ -53,11 +53,8 @@ void => {
}); });
afterAll(async(): Promise<void> => { afterAll(async(): Promise<void> => {
// Stop the server
await app.stop();
// Execute the configured teardown
await teardown(); await teardown();
await app.stop();
}); });
it('should not be affected by dangling locks.', async(): Promise<void> => { it('should not be affected by dangling locks.', async(): Promise<void> => {

View File

@ -45,8 +45,8 @@ describe('A server with seeded pods', (): void => {
}); });
afterAll(async(): Promise<void> => { afterAll(async(): Promise<void> => {
await app.stop();
await removeFolder(rootFilePath); await removeFolder(rootFilePath);
await app.stop();
}); });
it('has created the requested pods.', async(): Promise<void> => { it('has created the requested pods.', async(): Promise<void> => {

View File

@ -74,8 +74,8 @@ describe.each(stores)('A server supporting WebHookChannel2023 using %s', (name,
afterAll(async(): Promise<void> => { afterAll(async(): Promise<void> => {
clientServer.close(); clientServer.close();
await app.stop();
await teardown(); await teardown();
await app.stop();
}); });
it('links to the storage description.', async(): Promise<void> => { it('links to the storage description.', async(): Promise<void> => {