test: stabilize aggregate coverage waits
This commit is contained in:
@@ -27,6 +27,9 @@ const TEST_POLICY: CordisCatalogPolicy = {
|
||||
inheritedServices: [],
|
||||
}
|
||||
|
||||
// Cold TypeScript program creation can exceed Vitest's 5s default under aggregate coverage load.
|
||||
const COLD_PROGRAM_TIMEOUT = { timeout: 15_000 }
|
||||
|
||||
function collectEvents(root: string): EventEntry[] {
|
||||
return collectEventsWithPolicy(root, TEST_POLICY)
|
||||
}
|
||||
@@ -126,7 +129,7 @@ afterEach(() => {
|
||||
})
|
||||
|
||||
describe('gen-cordis-catalog collectEvents', () => {
|
||||
it('extracts a well-formed event with its @mode and JSDoc', () => {
|
||||
it('extracts a well-formed event with its @mode and JSDoc', COLD_PROGRAM_TIMEOUT, () => {
|
||||
const events = collectEvents(make(
|
||||
' /**\n * A thing happened.\n * @param id - which thing.\n * @mode emit\n */\n \'fix/happened\'(id: string): void',
|
||||
))
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -3897,8 +3897,9 @@ describe('skill slash command', () => {
|
||||
source: 'runtime',
|
||||
content: 'Dynamic body.',
|
||||
})
|
||||
await tick()
|
||||
expect(result.terminal.output).toContain('DYNAMIC_COMPLETION_MARKER')
|
||||
await vi.waitFor(() => {
|
||||
expect(result.terminal.output).toContain('DYNAMIC_COMPLETION_MARKER')
|
||||
})
|
||||
|
||||
result.terminal.send('\x03')
|
||||
disposeSkill()
|
||||
|
||||
Reference in New Issue
Block a user