hovancik / stretchly

The break time reminder app
https://hovancik.net/stretchly
BSD 2-Clause "Simplified" License
4.51k stars 436 forks source link

Migrate to vitest #1431

Closed cany748 closed 7 months ago

cany748 commented 7 months ago

Issue: #1417

Requirements

Description of the Change

Verification Process

Other information

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (efc25a9) 72.39% compared to head (4f7f011) 13.71%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #1431 +/- ## =========================================== - Coverage 72.39% 13.71% -58.69% =========================================== Files 14 27 +13 Lines 355 1845 +1490 =========================================== - Hits 257 253 -4 - Misses 98 1592 +1494 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hovancik commented 7 months ago

Thanks! Will need to find time to check the changes, but Coverage seems to not go through

hovancik commented 7 months ago

I am also getting The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

cany748 commented 7 months ago

I am also getting The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

There's nothing wrong with that, electron now supports ESIM and it will be easy to switch in the future

cany748 commented 7 months ago

I fixed the coverage, but there are some differences:

  1. Vitest takes into account not only files in the app/utils folder, but also the entire app folder. This can be easily fixed by setting coverage: { include: ["app/utils"] }
  2. Vitest also counts files without tests as 0% coverage. I believe this is the correct behavior, but if you disagree with me, this can also be changed via configuration.
  3. We will need to create separate tests for the defaultBreakIdeas.js anddefaultMicrobreakIdeas.js files.

Otherwise, coverage is very similar

hovancik commented 7 months ago

Thanks! I don't really care about the coverage number, I usually only look on difference when having new commits so looks good!