Skip to content

Commit 24daf6b

Browse files
committed
test(workflow-code): the warning-cap test derives its count from FINDING_LIMITS and asserts the cap was hit
1 parent fd76d2b commit 24daf6b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/workflow-code/src/compile/checks.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
import { describe, expect, it } from 'vitest'
66
import type { BlockCatalog, CatalogBlock } from '../catalog/types'
7+
import { FINDING_LIMITS } from '../diagnostics/bound'
78
import type { CanonicalWorkflow } from '../model'
89
import { TEST_CATALOG } from './catalog.test-helpers'
910
import type { CompileResult } from './index'
@@ -601,7 +602,10 @@ describe('typed references in JSON fields', () => {
601602
})
602603

603604
it('keeps a reference to an output the block lacks out of W_JSON_REF_UNTYPED past the warning cap', () => {
604-
const fields = Array.from({ length: 25 }, (_, i) => `k${i}: a.missing${i}`).join(', ')
605+
const fields = Array.from(
606+
{ length: FINDING_LIMITS.warningsPerCode + 5 },
607+
(_, i) => `k${i}: a.missing${i}`
608+
).join(', ')
605609
const result = run(
606610
[
607611
START,
@@ -611,6 +615,8 @@ describe('typed references in JSON fields', () => {
611615
'a.to(b)',
612616
].join('\n')
613617
)
618+
expect(findings(result, 'W_UNKNOWN_OUTPUT_PATH')).toHaveLength(FINDING_LIMITS.warningsPerCode)
619+
expect(findings(result, 'I_FINDINGS_TRUNCATED')).toHaveLength(1)
614620
expect(findings(result, 'W_JSON_REF_UNTYPED')).toEqual([])
615621
})
616622

0 commit comments

Comments
 (0)