test: stabilize aggregate coverage waits

This commit is contained in:
Hypatia May
2026-07-30 19:19:35 +08:00
parent 4f61bb536a
commit bf1f06d398
3 changed files with 11 additions and 6 deletions

View File

@@ -172,9 +172,10 @@ describe('typert loader', () => {
expect(ctx.typert.get('@fixture/late#Late')).toBeUndefined()
await ctx.loader.create({ name: '@fixture/late' })
await ctx.loader.await()
// The microtask flush and the dynamic import need a turn to settle.
await new Promise(resolve => setTimeout(resolve, 20))
expect(ctx.typert.get('@fixture/late#Late')).toBeDefined()
// Contributor import settles after Loader's own await boundary.
await vi.waitFor(() => {
expect(ctx.typert.get('@fixture/late#Late')).toBeDefined()
}, { timeout: 10_000 })
})
it('drops an in-flight manifest when the loader is disposed before import settles', LOADER_TEST_TIMEOUT, async () => {