-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GS-8167 Migrate from jest to vitest #258
Conversation
|
'<rootDir>/packages/*/src/**/*.js', | ||
'!<rootDir>/packages/*/src/**/*.test.js', | ||
], | ||
reporters: ['default', ['github-actions', { silent: false }]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In vite, github-actions
is default.
coverageReporters: ['lcov'], | ||
collectCoverageFrom: [ | ||
'<rootDir>/packages/*/src/**/*.js', | ||
'!<rootDir>/packages/*/src/**/*.test.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All test files are excluded from coverage.
Hey @sandhya-spend can we review that? If so, can you move to |
I am checking that the ci runs well, thats why its in draft. |
/* https://jestjs.io/docs/configuration */ | ||
|
||
export default { | ||
coverageProvider: 'v8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v8
is the default coverage provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Coverage is reported in PR
- Tests run both globally and per package
🎉 🎉 🎉 Outstanding work! There was nothing I could find fault with this work, just a couple of comments.
The tests run even faster now and it on top of that, it allow us to more easily introduce TypeScript!
.github/workflows/pull-request.yaml
Outdated
run: yarn run jest --ci --reporters github-actions --reporters summary --coverage . | ||
env: | ||
NODE_OPTIONS: '--no-warnings --experimental-vm-modules' | ||
run: yarn run test --reporter github-actions --reporter default --coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Remove reporters configuration
github-actions
is the default when running in CI and default
is well, the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, missed it.
process.env.VITE_MONGO_URI = global.__mongoServer.getUri() | ||
} | ||
|
||
// https://nodkz.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the updated, working link: https://typegoose.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners
Coverage after merging GS-8167/vitest into main will be
Coverage Report
|
GS-8167
Update repo to use
vitest
instead ofjest
.Note:
mobx
imports have the warningThis is resolved in a later version of
mobx
and needs to be separate task.