Repository navigation
test: collect coverage - #2
Conversation
ddeboer
commented
Jun 21, 2025
- Use Vitest instead of Jest because it has coverage threshold bumping built-in.
* Use Vitest instead of Jest because it has coverage threshold bumping built-in.
|
View your CI Pipeline Execution ↗ for commit 962de8f.
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Pull Request Overview
This PR replaces Jest with Vitest to use its built-in coverage threshold bumping and updates project configs and dependencies accordingly.
- Introduces a base Vitest configuration and merges it into the client package
- Removes legacy Jest config and updates dependencies to include Vitest and related plugins
- Registers the Nx Vite plugin and adjusts ESLint to ignore generated Vite/Vitest files
Reviewed Changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.base.config.ts | Add global Vitest test configuration |
| packages/dataset-registry-client/vite.config.ts | Merge base config and set project-specific thresholds |
| packages/dataset-registry-client/jest.config.ts | Remove legacy Jest configuration |
| package.json | Bump Nx plugins, add Vitest deps & scripts |
| nx.json | Register @nx/vite/plugin |
| jest.preset.js | Enable coverage collection in Jest preset |
| eslint.config.mjs | Ignore Vite/Vitest timestamp files & extend allow patterns |
Comments suppressed due to low confidence (2)
jest.preset.js:6
- [nitpick] Since testing is migrating from Jest to Vitest, review whether this Jest preset block is still needed or can be removed to eliminate unused legacy configuration.
collectCoverage: true,
package.json:31
- Jest-related dependencies remain despite switching to Vitest. If Jest is no longer used downstream, consider removing these to streamline your dependency footprint.
"jest": "^29.7.0",
| @@ -0,0 +1,21 @@ | |||
| /// <reference types='vitest' /> | |||
| import { defineConfig, mergeConfig } from 'vite'; | |||
| import baseConfig from '../../vite.base.config.js'; | |||
There was a problem hiding this comment.
[nitpick] Because the source file is TypeScript (.ts), importing it as .js may confuse readers. Consider either importing the .ts path or adding a comment explaining runtime transpilation via jiti so intent is clear.
| import baseConfig from '../../vite.base.config.js'; | |
| import baseConfig from '../../vite.base.config.ts'; |
| "eslint-config-prettier": "^10.0.0", | ||
| "husky": "^9.1.7", | ||
| "jest": "^29.7.0", | ||
| "jest-coverage-thresholds-bumper": "^1.1.0", |
There was a problem hiding this comment.
The bump-coverage-thresholds target currently runs cat package.json, which does not invoke the coverage-bumper tool. Update the command to use the CLI (e.g., jest-coverage-thresholds-bumper bump) to actually bump thresholds.
| allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'], | ||
| allow: [ | ||
| '^.*/eslint(\\.base)?\\.config\\.[cm]?js$', | ||
| '^.*/vite(\\.base)?\\.config\\.?js', |
There was a problem hiding this comment.
[nitpick] This regex only matches .js config files. To avoid lint errors on TypeScript-based configs (e.g., .ts), consider extending it to match both .js and .ts variants (e.g., \.config\.[cm]?[jt]s).
| '^.*/vite(\\.base)?\\.config\\.?js', | |
| '^.*/vite(\\.base)?\\.config\\.[cm]?[jt]s$', |