Repository navigation
test: typecheck rules tests scaffolding, real 30s timeout in audit-engine - #1862
Merged
Merged
Conversation
… real in audit-engine (Part of #1859) Signed-off-by: Nik Cubrilovic <[email protected]>
…t.json #1859 Signed-off-by: Nik Cubrilovic <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1859.
(a)
template-signature-coverage-1373.test.ts: removed the@ts-expect-error; the 30 s now applies for real via file-scopedsetDefaultTimeout(30_000)(Bun's describe() has no timeout slot, so it never applied before).(b) packages/rules: added
@types/bun^1.4.0 devDependency andtypes: [bun, node](src typechecks clean with them). Tests are NOT in tsconfig.json; they live inpackages/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 arerule.run()returningPromise<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 typecheckexit 0; rootbun run typecheck(as CI) exit 0;bunx tsgo --noEmit -p tsconfig.test.jsonhas 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