-
Notifications
You must be signed in to change notification settings - Fork 206
Migrate from karma to vitest to run unit tests #6988
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
base: main
Are you sure you want to change the base?
Conversation
8d782a4
to
41637dd
Compare
headless: true, | ||
screenshotFailures: false, | ||
instances: [{ browser: 'chromium' }], | ||
viewport: { width: 1024, height: 768 }, |
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.
There's a bunch of tests that rely on the screen resolution, like the ones around side-by-side mode.
Karma sets bigger screen resolutions, but vitest uses a mobile screen resolution by default. I reckon we probably want to have more control over this and makes sense to set it here.
dfeefbb
to
97d5a42
Compare
yarn.lock
Outdated
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.
Many of the changes here are caused by running yarn dedupe
, which was required to fix an incompatibility between different istanbul versions.
80c9e79
to
1a2dae8
Compare
1a2dae8
to
8ee6ac9
Compare
8ee6ac9
to
b7a0747
Compare
b8b174d
to
3813020
Compare
d701d1f
to
643249c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6988 +/- ##
==========================================
- Coverage 99.50% 99.39% -0.12%
==========================================
Files 278 276 -2
Lines 11054 11010 -44
Branches 2662 2653 -9
==========================================
- Hits 10999 10943 -56
- Misses 55 67 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9bae1af
to
5b52a31
Compare
There's a 1% decrease in code coverage, I'm not completely sure why 🤔 |
I'm investigating some eslint errors. I need to understand why this is not being reported in other projects 🤔 |
No other project is complaining about this because this is the only one using |
It looks to me like the main reason is that some source files ( |
Yeah, that sounds reasonable, but I can't find where were we excluding those files before 🤔 |
'**/node_modules/**', | ||
'**/test/**/*.js', | ||
'**/test-util/**', | ||
'src/**/index.{ts,tsx}', |
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.
Excluding module index files from coverage, because they were not being considered for code coverage when using karma.
After excluding index files from code coverage, it is still dropping 0.12%. I'm not sure if it's worth going module by module checking what's going on. I would probably merge this as is, and we can focus on improving the code coverage separately. |
I just realized Codecov has an "Indirect changes" tab that indicates what coverage changes have happened in files that were not changed in the PR: https://app.codecov.io/gh/hypothesis/client/pull/6988/indirect-changes |
This PR is the equivalent to hypothesis/frontend-shared#1947, but for client repository.
TODO
Investigate some suspicious output printed after starting tests.Frontend-shared has a similar output in one test. Let's investigate this separately