Skip to content

fix(auth): type-check test files via tsconfig IDE/build split#20711

Open
nshirley wants to merge 1 commit into
mainfrom
FXA-13782
Open

fix(auth): type-check test files via tsconfig IDE/build split#20711
nshirley wants to merge 1 commit into
mainfrom
FXA-13782

Conversation

@nshirley

@nshirley nshirley commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Because:

  • fxa-auth-server's tsconfig orphaned spec files (specs excluded, test/ never included), so editors showed spurious "Cannot find name 'describe'" and real spec type errors were silenced (FXA-13782).

This commit:

  • tsconfig.json (IDE) includes test/ + moduleDetection:force so legacy require()-style specs get jest types without colliding.
  • Adds tsconfig.build.json (excludes specs/test) for emit + CI type-check, keeping dist test-free and compile green; points build-ts/compile at it.

Closes: FXA-13782

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

@nshirley nshirley marked this pull request as ready for review June 9, 2026 21:39
@nshirley nshirley requested a review from a team as a code owner June 9, 2026 21:39
Copilot AI review requested due to automatic review settings June 9, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts fxa-auth-server’s TypeScript configuration to type-check test/spec files in editors (surfacing real test type errors and enabling Jest globals), while keeping build/CI emit and compile checks focused on shippable code only.

Changes:

  • Update tsconfig.json (IDE default) to include test/**/* and force module detection to avoid global-scope collisions among legacy require()-style specs.
  • Add tsconfig.build.json to exclude tests/specs for emit and CI --noEmit type-checks.
  • Point build-ts and compile scripts at tsconfig.build.json.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/fxa-auth-server/tsconfig.json Includes test/**/* for IDE type-checking and sets moduleDetection: "force" to prevent spec-file global redeclare errors.
packages/fxa-auth-server/tsconfig.build.json New build/CI config extending IDE config but excluding tests/specs and restoring prior module detection behavior.
packages/fxa-auth-server/package.json Routes build/type-check scripts through tsconfig.build.json and aligns tsc-alias invocation accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/fxa-auth-server/tsconfig.build.json Outdated
Because:
- fxa-auth-server's tsconfig orphaned spec files (specs excluded, test/ never
  included), so editors showed spurious "Cannot find name 'describe'" and real
  spec type errors were silenced (FXA-13782).

This commit:
- tsconfig.json (IDE) includes test/ + moduleDetection:force so legacy
  require()-style specs get jest types without colliding.
- Adds tsconfig.build.json (excludes specs/test) for emit + CI type-check,
  keeping dist test-free and compile green; points build-ts/compile at it.

fxa-shared and gating the surfaced spec errors in CI are separate follow-ups.
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.

2 participants