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

Switch from jest to vitest #21444

Merged
merged 6 commits into from Oct 14, 2022
Merged

Switch from jest to vitest #21444

merged 6 commits into from Oct 14, 2022

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Oct 13, 2022

Even if we are not bundling with vite yet, we can use vitest in place of Jest which brings a few benefits like not requiring to use NODE_OPTIONS to run and having sane module resolution.

It's possible to also use jest-extended with vitest, but I opted to not do so for now because it brings heavyweight dependencies and it was trivial to just rewrite the affected matchers to be compatible.

This PR also removes 153 JS dependencies, which is certainly nice.

@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Oct 13, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 13, 2022
@6543 6543 added this to the 1.18.0 milestone Oct 13, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 14, 2022
vitest.config.js Outdated Show resolved Hide resolved
@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 14, 2022

This PR also removes 153 JS dependencies, which is certainly nice.

npm install:
https://img-9gag-fun.9cache.com/photo/aQEpZB7_460svvp9.webm

@silverwind

This comment was marked as off-topic.

@silverwind
Copy link
Member Author

threads option is enabled again. It makes local tests a second slower but provides isolation between tests and it should overall become faster with increased number of tests.

@lunny lunny merged commit c309807 into go-gitea:main Oct 14, 2022
techknowlogick pushed a commit that referenced this pull request Oct 14, 2022
The vitest PR is merged, we can now add vitest to Gitpod's testing pane
* #21444

We couldn't use jest in the same manner because we had to customize
`NODE_OPTIONS`.

Screenshot (look at all the cool stuff circled in red):

![image](https://user-images.githubusercontent.com/20454870/195728971-9a2eaa80-8d91-4e4f-899b-a068edb9ff30.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants