Skip to content

build(packages): typecheck the tests of the remaining 8 packages #1859 - #2190

Merged
nc9 merged 1 commit into
mainfrom
boat/typecheck-tests-1859
Nov 21, 2026
Merged

nc9 merged 1 commit into
mainfrom
boat/typecheck-tests-1859

Conversation

@nc9

@nc9 nc9 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Closes #1859 (the remaining 8 packages; audit-engine and rules landed in #1861 and #1862).

Summary

Same pattern as packages/parser after #1858: each package's tsconfig.json now includes tests/**/*.ts, so its existing typecheck script, the root bun run typecheck and CI's "Format, lint, and typecheck" job cover the tests.

  • crawler, report, utils: include tests/**/*.ts (types were already set).
  • tech-detect, core-contracts, config, waf-detect, threat-intel: also "types": ["bun"] and an @types/bun ^1.4.0 devDependency (already in bun.lock; the lock diff only adds five devDependency blocks).
  • config: dropped "rootDir": "src" (incompatible with tests outside src). The package has no emit or build consumer, so nothing else uses it.
  • 221 surfaced type errors (crawler 75, tech-detect 57, core-contracts 33, waf-detect 28, report 11, config 9, utils 5, threat-intel 3) fixed in tests only. No src changes. No assertion changed.

Changes that affect test behaviour (called out per the criteria)

  • { timeout: 20_000 } moved from the 2nd to the 3rd test() argument in packages/report/tests/lcp-preload-grouping-1074.test.ts ("evidence stays bounded across several hundred pages", "2048-char page and image URLs stay inside the finding payload cap"). Those timeouts now apply; before, bun ignored them and the default applied. No other misplaced timeouts exist: bun-types' Describe has no 3rd slot, so any describe(..., timeout) would now fail typecheck.
  • packages/crawler/tests/entry-fetch-timeout.test.ts: fixture FetchResponse gains the required url: req.url.
  • packages/crawler/tests/frontier-trailing-slash.test.ts: options gain dropQueryPrefixes: [] (required by the type; empty, so normalization is unchanged).
  • packages/crawler/tests/crawl-lease.test.ts: winner?.pid to winner!.pid, right after expect(winner).toBeDefined().
  • packages/tech-detect/tests/hint-derive-soundness-1420.test.ts: /(a)\12bcde/ became new RegExp(String.raw\(a)\12bcde`)`, the same source and flags at runtime (TS rejects the legacy octal escape in a literal).
  • Everything else is type-only: as unknown as casts for partial fixtures (crawl config snapshots, report fixtures), Buffer<ArrayBuffer> and BodyInit typings, explicit ReturnType<typeof Bun.serve> annotations, imports from the modules that export the types, as const and typed test.each/expect<string[]>.

Acceptance criteria

Gates

  • bun run scripts/test-suites.ts --check OK; bun run format:check exit 0; bun run lint exit 0; bun run typecheck exit 0; bun run notices:check OK; bun scripts/changelog.ts check OK.
  • CI test steps: test-suites.ts --run report 1413 pass 0 fail (122 files); --run crawler 1180 pass 0 fail (129 files).
  • utils, tech-detect, core-contracts, config, waf-detect, threat-intel: every test file by explicit path, batches of 5, --timeout 30000: 2694 pass 0 fail.

No changelog.d entry: no user-visible change. squirrelscan agent skill change needed: no.

…detect, core-contracts, config, waf-detect, threat-intel #1859

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 marked this pull request as ready for review November 20, 2026 23:36
@nc9
nc9 merged commit 5e9ade4 into main Nov 21, 2026
8 of 15 checks passed
@nc9
nc9 deleted the boat/typecheck-tests-1859 branch November 21, 2026 00:57
nc9 added a commit that referenced this pull request Nov 21, 2026
* origin/main:
  test(install,audit-engine): run install-hardening and attestation cases concurrently, copy the canonical crawl DB in javascript-shipped #1839 (#2186)
  build(packages): typecheck the tests of crawler, report, utils, tech-detect, core-contracts, config, waf-detect, threat-intel #1859 (#2190)
  fix(cli): refuse a run whose config rule selection plus WCAG level leaves zero rules #2110 (#2156)
  fix(rules): links/anchor-mismatch false positives on translated stores #2092 (#2162)
  fix(rules): coded gap skips for input not fully checked, batch 2 rules #2134 (#2163)
  test(audit-engine): carriedCheckAsFailure keeps the continuation mark #2098 (#2166)
  fix(rules): correct zoom-disabled 1.4.4 wording, related criteria for wcagNone rules #2115 (#2174)
  refactor(cli): list bash completion flags one per line #2116 (#2175)
  feat(rules): waive a public Supabase table by bare name in security/supabase-rls #2103 (#2177)
  test(rules): every site rule emits a check on a clean site, with a shrinking baseline #1741 (#2179)
  feat(rules): report each 5xx page as its own crawl/server-errors finding #2130 (#2181)

Signed-off-by: Nik Cubrilovic <[email protected]>
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.

Typecheck the tests of 10 packages whose tsconfig covers src/ only (audit-engine and rules first)

1 participant