chore(auth-server): add project.json for VSCode test explorer#20377
chore(auth-server): add project.json for VSCode test explorer#20377
Conversation
There was a problem hiding this comment.
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.jsonto define Nx targets, including a Jest-backedtest-unittarget. - Added
displayName: 'fxa-auth-server'topackages/fxa-auth-server/jest.config.jsfor 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.
| "executor": "@nx/jest:jest", | ||
| "outputs": ["{workspaceRoot}/artifacts/tests/fxa-auth-server"], | ||
| "options": { | ||
| "jestConfig": "packages/fxa-auth-server/jest.config.js", | ||
| "passWithNoTests": true | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
040c170 to
47d1ff4
Compare
47d1ff4 to
99c9321
Compare
…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
99c9321 to
c97312c
Compare
Because:
getJestProjectsAsync()skips it and the VSCode Jest Test Explorer never showed its tests.This commit:
CI is unaffected — yarn test-unit still delegates to scripts/test-ci.sh.
Checklist
Put an
xin the boxes that applyHow to review (Optional)
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.

I hit a few quirks with the runner with this.
cmd+shift+pby default, and runningDeveloper: Reload WindowOther information (Optional)
Any other information that is important to this pull request.