Skip to content
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

Try Vitest test runner on this repository #21301

Open
11 tasks
HonkingGoose opened this issue Apr 3, 2023 · 6 comments
Open
11 tasks

Try Vitest test runner on this repository #21301

HonkingGoose opened this issue Apr 3, 2023 · 6 comments
Assignees
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:refactor Refactoring or improving of existing code

Comments

@HonkingGoose
Copy link
Collaborator

HonkingGoose commented Apr 3, 2023

Describe the proposed change(s).

I think we want to try the Vitest test runner, to see if it's faster then Jest? I've created this issue to discuss things, and so I can link to other relevant issues.

Vitest says that: 1

Vitest has been designed with a Jest compatible API, in order to make the migration from Jest as simple as possible. Despite those efforts, you may still run into the following differences:

Todos to migrate to Vitest

These todos come from the Vitest guide to migrate from Jest:

  • Keep the globals API from Jest with the globals configuration setting or update code to use imports from the vitest module instead
  • Module mocks
  • Auto-mocking behavior
  • Importing the original of a mocked package
  • Jasmine API
  • Envs
  • Done Callback
  • beforeAll/beforeEach hooks
  • Types
  • Timers (Vitest doesn't support Jest's legacy timers)
  • Vue Snapshots (we probably don't use any?)

Discussion

Some things to think about:

  • Vitest is not stable, the current release is v0.32.2.
  • Vitest supports running consecutive tests in parallel. 2
  • Supports native code coverage via v8 (default) and instrumental code coverage via istanbul 3
  • Read Vitest's test runner comparison page 4

Related issues:

Is this a feature you are interested in implementing yourself?

No, I'll let somebody else test Vitest. 😉

Footnotes

  1. https://vitest.dev/guide/migration.html#migrating-from-jest

  2. https://vitest.dev/guide/features.html#running-tests-concurrently

  3. https://vitest.dev/guide/coverage.html

  4. https://vitest.dev/guide/comparisons.html

@HonkingGoose HonkingGoose added priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:refactor Refactoring or improving of existing code status:ready labels Apr 3, 2023
@HonkingGoose
Copy link
Collaborator Author

@zharinov sped up the tests massively. 🥳 My latest docs PR got automerged by GitHub via Merge Queue in about 10 minutes, compared to about 25 minutes before the changes. 😱

Do the maintainers still want to try Vitest, or are we happy with our current test speed?

@viceice
Copy link
Member

viceice commented Jun 16, 2023

yes, would like to try it.

@viceice
Copy link
Member

viceice commented Jun 16, 2023

i think I've not enough time to make it alone 🙃

@RahulGautamSingh
Copy link
Collaborator

i think I've not enough time to make it alone 🙃

I would be happy to contribute here too☺

@viceice
Copy link
Member

viceice commented Jun 16, 2023

not sure about the best way to start. does vitest have something like the jest.mock functions? so we can try to create some compabillity stuff?

@viceice
Copy link
Member

viceice commented Jun 16, 2023

https://vitest.dev/guide/migration.html
🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:refactor Refactoring or improving of existing code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants