Skip to content

chore(auth-server): add project.json for VSCode test explorer#20377

Open
nshirley wants to merge 1 commit intomainfrom
worktree-auth-server-jest-ui-runner
Open

chore(auth-server): add project.json for VSCode test explorer#20377
nshirley wants to merge 1 commit intomainfrom
worktree-auth-server-jest-ui-runner

Conversation

@nshirley
Copy link
Copy Markdown
Contributor

@nshirley nshirley commented Apr 15, 2026

Because:

  • fxa-auth-server had no project.json so it was invisible to the Nx project graph; getJestProjectsAsync() skips it and the VSCode Jest Test Explorer never showed its tests.

This commit:

  • Adds packages/fxa-auth-server/project.json registering the package with Nx; the test-unit target uses @nx/jest:jest so getJestProjectsAsync() returns the jest config path, making tests discoverable in the explorer
  • Adds displayName: 'fxa-auth-server' to jest.config.js so the explorer labels the project correctly

CI is unaffected — yarn test-unit still delegates to scripts/test-ci.sh.

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)

Note

Worth calling out, this is ONLY for unit tests. Integration tests proved to be difficult because of test-server setup and may need to wait for that to be stripped out

Here's the VSCode extension able to discover the tests.
image

I hit a few quirks with the runner with this.

  • You might need to reload the vscode instance, this can be done by opening the command pallet cmd+shift+p by default, and running Developer: Reload Window
  • The first time running a test from the explorer might look like it's hanging, just check Test Results panel to see if it's processing. I'm not sure what this delay is, maybe something with nx happening in the background?
  • When drilling down into tests, the explorer might not be able to discover tests for a module unless that module is open. So, don't just click the arrow, but click the module itself to open it in the editor
    • Before, not showing tests: image
    • After, clicked module and open in editor: image

Other information (Optional)

Any other information that is important to this pull request.

@nshirley nshirley requested a review from a team as a code owner April 15, 2026 16:13
Copilot AI review requested due to automatic review settings April 15, 2026 16:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Registers packages/fxa-auth-server as an Nx project so Nx/Jest tooling (notably VSCode Jest Test Explorer via getJestProjectsAsync()) can discover and label its Jest configuration correctly.

Changes:

  • Added packages/fxa-auth-server/project.json to define Nx targets, including a Jest-backed test-unit target.
  • Added displayName: 'fxa-auth-server' to packages/fxa-auth-server/jest.config.js for clearer project labeling in Jest tooling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/fxa-auth-server/project.json Registers fxa-auth-server with Nx and defines test-* targets (unit via @nx/jest:jest, others via run-commands).
packages/fxa-auth-server/jest.config.js Adds displayName to improve test project labeling in Jest explorers/reporters.

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

Comment thread packages/fxa-auth-server/project.json Outdated
Comment on lines +9 to +14
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/artifacts/tests/fxa-auth-server"],
"options": {
"jestConfig": "packages/fxa-auth-server/jest.config.js",
"passWithNoTests": true
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

outputs is currently limited to the junit directory under artifacts/tests, but this target runs Jest and jest.config.js writes coverage to ../../artifacts/coverage/fxa-auth-server-jest when --coverage is enabled. With the current outputs, Nx caching/artifact tracking may miss the coverage directory, and the hard-coded path duplicates the project name. Consider either removing the explicit outputs (rely on defaults) or using placeholders and including the coverage output directory as well.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since this is currently only added so the vscode explorer can discover the tests, this isn't necessarily an issue. But, I'll remove the outputs and rely on the default for now

@nshirley nshirley marked this pull request as draft April 17, 2026 17:20
@nshirley nshirley force-pushed the worktree-auth-server-jest-ui-runner branch from 040c170 to 47d1ff4 Compare April 30, 2026 18:23
Comment thread packages/fxa-auth-server/test/remote/account_create_with_code.in.spec.ts Outdated
@nshirley nshirley force-pushed the worktree-auth-server-jest-ui-runner branch from 47d1ff4 to 99c9321 Compare April 30, 2026 19:14
@nshirley nshirley marked this pull request as ready for review April 30, 2026 19:17
…test explorer

Because:
- fxa-auth-server had no project.json so it was invisible to the
Nx project graph; getJestProjectsAsync() skipped it and the VSCode Jest
Test Explorer never showed its tests.

This commit:
- Adds packages/fxa-auth-server/project.json registering the package
  with Nx; the test-unit target uses @nx/jest:jest so getJestProjectsAsync()
  returns the jest config path, making tests discoverable in the explorer
- Adds displayName: 'fxa-auth-server' to jest.config.js so the explorer
  labels the project correctly
@nshirley nshirley force-pushed the worktree-auth-server-jest-ui-runner branch from 99c9321 to c97312c Compare May 1, 2026 16:41
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