Skip to content

test: typecheck rules tests scaffolding, real 30s timeout in audit-engine - #1862

Merged
nc9 merged 2 commits into
mainfrom
boat/typecheck-tests-rules-1859
Nov 14, 2026
Merged

nc9 merged 2 commits into
mainfrom
boat/typecheck-tests-rules-1859

Conversation

@nc9

@nc9 nc9 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1859.

(a) template-signature-coverage-1373.test.ts: removed the @ts-expect-error; the 30 s now applies for real via file-scoped setDefaultTimeout(30_000) (Bun's describe() has no timeout slot, so it never applied before).

(b) packages/rules: added @types/bun ^1.4.0 devDependency and types: [bun, node] (src typechecks clean with them). Tests are NOT in tsconfig.json; they live in packages/rules/tsconfig.test.json (not wired to any script or CI). This surfaced 1158 errors (710 TS2339, 302 TS7006, rest misc), over the 150 threshold, so this PR fixes the first batch only (type-only: await on rule.run results, typed helper): link-checks-not-run, keyword-stuffing, sitemap-lastmod-drift, cookie-flags, rate-limited-links, forms-ux. Remaining: 952 errors; most are rule.run() returning Promise<RuleResult> | RuleResult, fixed by awaiting in async tests. Top remaining files: rate-limited-links neighbors, tel-mailto, form-captcha, a11y-nested-tables-3355, external-links-not-requested-2759, email-protection-838, sri, leaked-secrets. Not closing #1859.

Gates: audit-engine typecheck clean; packages/rules bun run typecheck exit 0; root bun run typecheck (as CI) exit 0; bunx tsgo --noEmit -p tsconfig.test.json has 952 errors remaining (the follow-up target); touched rules tests pass (link-checks-not-run 35, keyword-stuffing 78, sitemap-lastmod-drift 33, cookie-flags 28, rate-limited-links 18, forms-ux 73); audit-engine template-signature test 5 pass.

Skill change needed: no.

Remaining pattern: tests use the result of rule.run() (Promise<RuleResult> | RuleResult) without await (TS2339 on .checks/.items, plus implicit-any callbacks).

Possibly vacuous (heuristic grep: un-awaited run() result asserted with toBeUndefined/not.toContain/toBe(false)/etc.; not fixed here, some may be fine if the helper awaits):
empty-heading.test.ts, form-field-multiple-labels-1249.test.ts, identical-links-same-purpose.test.ts, no-contextual-inbound.test.ts, dom-size.test.ts, content-unrendered-markup.test.ts, probe-path-not-approved-1655.test.ts, framework-data-payload-1143.test.ts, security/leaked-secrets-budget-overrun-1556.test.ts, security/leaked-secrets-public-tier.test.ts

@nc9
nc9 marked this pull request as ready for review November 14, 2026 15:28
@nc9
nc9 merged commit 3fcefec into main Nov 14, 2026
16 checks passed
@nc9
nc9 deleted the boat/typecheck-tests-rules-1859 branch November 14, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant