Skip to content

feat(toolchain): jest test-gate auto-detection + multi-ext arch scan for JS/TS (F-47b8bee5)#217

Open
yuyu04 wants to merge 1 commit into
qwerfunch:developfrom
yuyu04:feature/ts-jest-multiext-arch
Open

feat(toolchain): jest test-gate auto-detection + multi-ext arch scan for JS/TS (F-47b8bee5)#217
yuyu04 wants to merge 1 commit into
qwerfunch:developfrom
yuyu04:feature/ts-jest-multiext-arch

Conversation

@yuyu04

@yuyu04 yuyu04 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Fixes two silent usability footguns for React / React Native / CRA projects, which all resolve to language: 'typescript' via package.json.

1. Jest test-gate auto-detection

The test gate defaulted to vitest unconditionally, so Jest-based projects hit npx --no-install vitest, found nothing, and silently skipped stage_2.1 (unit) + stage_2.2 (coverage) — no tests gated at all.

resolveTsGates now detects the runner the project actually configured (mirrors the existing resolveTsLint biome/oxlint detection):

  • jest.config.{js,ts,mjs,cjs,json} present, or a jest key in package.jsonnpx --no-install jest / jest --coverage
  • no jest config → vitest default unchanged (backward compatible)
  • composes independently with linter detection (jest + biome → jest test, biome lint)

2. Multi-extension arch scan

madge --extensions ts missed .tsx/.jsx/.js, so circular-dependency detection was blind to React/JSX component trees. Widened to ts,tsx,js,jsx. (node_modules is excluded by madge default — verified no dependency-tree blowup; 323 files scanned on this repo.)

Spec

  • Feature F-47b8bee5 (3 ACs, EARS-compliant), module-bound to src/stages/toolchain/detect.ts.

Tests

  • 11 new cases in tests/stages/toolchain.test.ts, authored impl-blind in a separate context (per the persona-separation invariant).
  • clad done F-47b8bee5strict pre-push gate GREEN (rebased onto develop, re-verified).

🤖 Generated with Claude Code

…for JS/TS (F-47b8bee5)

React/JS-family projects resolve to language 'typescript' but the toolchain
defaulted the test gate to vitest unconditionally and scanned only .ts in the
arch (madge) gate. Two silent footguns for React/RN/CRA repos:

- Jest projects hit `npx --no-install vitest`, found nothing, and SILENTLY
  skipped stage_2.1 (unit) / stage_2.2 (coverage). Now `resolveTsGates`
  detects a jest.config.{js,ts,mjs,cjs,json} file or a `jest` key in
  package.json (mirroring resolveTsLint's presence-based detection) and gates
  with jest / jest --coverage. No jest config → vitest default unchanged.

- madge `--extensions ts` missed .tsx/.jsx/.js, so circular-dependency
  detection was blind to React/JSX component trees. Widened to ts,tsx,js,jsx
  (node_modules is excluded by madge default, so no dependency-tree blowup).

Tests authored impl-blind in a separate context (11 new cases in
tests/stages/toolchain.test.ts). strict pre-push gate GREEN.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yuyu04 yuyu04 force-pushed the feature/ts-jest-multiext-arch branch from d97c167 to c0ef1b4 Compare July 2, 2026 01:25
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