test: stabilize aggregate coverage waits
This commit is contained in:
@@ -27,6 +27,9 @@ const TEST_POLICY: CordisCatalogPolicy = {
|
|||||||
inheritedServices: [],
|
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[] {
|
function collectEvents(root: string): EventEntry[] {
|
||||||
return collectEventsWithPolicy(root, TEST_POLICY)
|
return collectEventsWithPolicy(root, TEST_POLICY)
|
||||||
}
|
}
|
||||||
@@ -126,7 +129,7 @@ afterEach(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('gen-cordis-catalog collectEvents', () => {
|
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(
|
const events = collectEvents(make(
|
||||||
' /**\n * A thing happened.\n * @param id - which thing.\n * @mode emit\n */\n \'fix/happened\'(id: string): void',
|
' /**\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()
|
expect(ctx.typert.get('@fixture/late#Late')).toBeUndefined()
|
||||||
await ctx.loader.create({ name: '@fixture/late' })
|
await ctx.loader.create({ name: '@fixture/late' })
|
||||||
await ctx.loader.await()
|
await ctx.loader.await()
|
||||||
// The microtask flush and the dynamic import need a turn to settle.
|
// Contributor import settles after Loader's own await boundary.
|
||||||
await new Promise(resolve => setTimeout(resolve, 20))
|
await vi.waitFor(() => {
|
||||||
expect(ctx.typert.get('@fixture/late#Late')).toBeDefined()
|
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 () => {
|
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',
|
source: 'runtime',
|
||||||
content: 'Dynamic body.',
|
content: 'Dynamic body.',
|
||||||
})
|
})
|
||||||
await tick()
|
await vi.waitFor(() => {
|
||||||
expect(result.terminal.output).toContain('DYNAMIC_COMPLETION_MARKER')
|
expect(result.terminal.output).toContain('DYNAMIC_COMPLETION_MARKER')
|
||||||
|
})
|
||||||
|
|
||||||
result.terminal.send('\x03')
|
result.terminal.send('\x03')
|
||||||
disposeSkill()
|
disposeSkill()
|
||||||
|
|||||||
Reference in New Issue
Block a user