diff --git a/tests/index.test.ts b/tests/index.test.ts index 004abf868..e90a31594 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -316,8 +316,8 @@ describe.each([{ permission: 'Master' }, { permission: 'Private' }])( test(`${permission} key: delete index using client`, async () => { const client = await getClient(permission) - const { taskUid } = await client.deleteIndex(indexPk.uid) await client.createIndex(indexPk.uid) + const { taskUid } = await client.deleteIndex(indexPk.uid) await client.waitForTask(taskUid) const { results } = await client.getIndexes() diff --git a/tests/keys.test.ts b/tests/keys.test.ts index dc260f16e..54c5362dc 100644 --- a/tests/keys.test.ts +++ b/tests/keys.test.ts @@ -10,6 +10,10 @@ beforeEach(async () => { await clearAllIndexes(config) }) +afterAll(() => { + return clearAllIndexes(config) +}) + describe.each([{ permission: 'Master' }, { permission: 'Private' }])( 'Test on keys', ({ permission }) => { diff --git a/tests/token.test.ts b/tests/token.test.ts index 1856fa41c..63f06f035 100644 --- a/tests/token.test.ts +++ b/tests/token.test.ts @@ -16,7 +16,7 @@ const TOKEN_TYP = 'JWT' const UID = 'movies_test' afterAll(() => { - clearAllIndexes(config) + return clearAllIndexes(config) }) describe.each([{ permission: 'Private' }])(