diff --git a/src/fs/protocol/private/mmpt.test.ts b/src/fs/protocol/private/mmpt.test.ts index 7796d096d..9aedb560b 100644 --- a/src/fs/protocol/private/mmpt.test.ts +++ b/src/fs/protocol/private/mmpt.test.ts @@ -16,16 +16,18 @@ function encode(str: string): Uint8Array { let ipfs: IPFS | null = null -beforeAll(async done => { +beforeAll(async () => { ipfs = await createInMemoryIPFS() ipfsConfig.set(ipfs) - done() }) -afterAll(async done => { +afterAll(async () => { if (ipfs == null) return await ipfs.stop() - done() + // This seems to trigger GC, which seems to + // close some file handles or smth, which + // causes jest to finish properly + ipfs = null }) /* diff --git a/tests/fs/integration.test.ts b/tests/fs/integration.test.ts index b8fdf9fcf..8f6e48414 100644 --- a/tests/fs/integration.test.ts +++ b/tests/fs/integration.test.ts @@ -21,6 +21,10 @@ beforeAll(async () => { afterAll(async () => { if (ipfs == null) return await ipfs.stop() + // This seems to trigger GC, which seems to + // close some file handles or smth, which + // causes jest to finish properly + ipfs = null })