-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
chore(web): migrate to vitest #5754
Merged
jrasm91
merged 9 commits into
immich-app:main
from
jorge-dev:fix/web-dev-server-and-tests
Jan 1, 2024
Merged
chore(web): migrate to vitest #5754
jrasm91
merged 9 commits into
immich-app:main
from
jorge-dev:fix/web-dev-server-and-tests
Jan 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d14196
to
4946666
Compare
… fix the dev command error
-- this removes jest dependencies
…jest-dom matchers in tests
4946666
to
e234e11
Compare
jrasm91
approved these changes
Jan 1, 2024
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.
LGTM. Thanks for re-enabling the tests again.
martabal
pushed a commit
that referenced
this pull request
Jan 9, 2024
* Updated vite and ts config file with vtest options and a new alias to fix the dev command error * Updated package script and update the packages -- this removes jest dependencies * Added new setup file needed in vitest in order to be able to use the jest-dom matchers in tests * Updated deprecated utilities when using faker * Updated test files and mocks to use vitest instead of jest * Enabled web test check in GitHub actions * remove babel dependencies as they are no longer needed with vitest * move the jest config files to a folder in case we need to go back to jest * chore: remove old files --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes an error while trying to run the
npm run dev
command and serve the application.This was due to a missing alias in the vite config file.
The change is to re-enable the existing unit tests that were failing after the update to Svelte 4.
Most of the tests were failing due to Jest trying to import packages using require instead of import since it was running in CSJ mode instead of ESM mode that Svelte 4 requires.
I spent 2 days trying to configure jest to fix this issue but nothing worked.
That was the main reason to try vitest for this project.
Vitest works with almost no extra configuration and it was built using ESM so all the tests were able to be fixed with very minor modifications since vitest's api is almost fully compatible with Jest API (with some exceptions)
These changes only affect the testing environment
![image](https://private-user-images.githubusercontent.com/20519640/291108789-17fec077-3dbc-49d1-b511-60734c431155.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MTgxMDMsIm5iZiI6MTcyMTQxNzgwMywicGF0aCI6Ii8yMDUxOTY0MC8yOTExMDg3ODktMTdmZWMwNzctM2RiYy00OWQxLWI1MTEtNjA3MzRjNDMxMTU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDE5MzY0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4OGI0ZmZmMGU3YzEyZDQ5M2M3MDRiNGZlMTMzN2E0NjY3NjA1OTBmNmQ5ZjNiZjRmZTY0MTFlNGRkM2Q1ZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7I8hj37dcVK1TQd52FrHXdwq8SHdMuVMgFVPMIr8O2k)