-
-
Notifications
You must be signed in to change notification settings - Fork 399
Migrate from Jest to Vitest #1202
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e9e16eb
Wip trying to migrate from jest to vitest
ChqThomas 10c5591
Add forgotten package.json from ux-react package
ChqThomas c1db340
Fixing problem where Stimulus sometimes continued after the test
weaverryan 9043da3
Removing no-longer-needed setup file
weaverryan 2270406
Switching to vitest-fetch-mock
weaverryan ef34031
Swapping in vitest-canvas-mock
weaverryan cf29587
Replacing require.context polyfill with a simpler implementation
weaverryan 238d25e
Stopping Stimulus to avoid side effects after the test
weaverryan ecba87b
Adding script to run all tests, but keep going if a previous one fails
weaverryan 13c7431
dropping support for very old versions of swup
weaverryan f59f4f6
Working around Turbo issue
weaverryan a33fc1d
Fixing final tests
weaverryan 2be4088
re-adding module
weaverryan 9322bc7
format
weaverryan de32106
Import vitest when needed instead of adding global types in tsconfig
ChqThomas f953d52
Remove jest config and dependencies
ChqThomas 7f37e59
vitest.config.js format
ChqThomas 76d82de
Removing need for jq
weaverryan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Get all workspace names | ||
| workspaces=$(yarn workspaces --json info | jq -r 'if .type == "log" then .data | fromjson | keys[] else empty end') | ||
|
|
||
| # Flag to track if any test fails | ||
| all_tests_passed=true | ||
|
|
||
| for workspace in $workspaces; do | ||
| echo "Running tests in $workspace..." | ||
|
|
||
| # Run the tests and if they fail, set the flag to false | ||
| yarn workspace $workspace run vitest --run || { echo "$workspace failed"; all_tests_passed=false; } | ||
| done | ||
|
|
||
| # Check the flag at the end and exit with code 1 if any test failed | ||
| if [ "$all_tests_passed" = false ]; then | ||
| echo "Some tests failed." | ||
| exit 1 | ||
| else | ||
| echo "All tests passed!" | ||
| exit 0 | ||
| fi | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { defineConfig, mergeConfig } from 'vitest/config'; | ||
| import configShared from '../../../vitest.config.js' | ||
| import path from 'path'; | ||
|
|
||
| export default mergeConfig( | ||
| configShared, | ||
| defineConfig({ | ||
| test: { | ||
| setupFiles: [path.join(__dirname, 'test', 'setup.js')], | ||
| deps: { | ||
| optimizer: { | ||
| web: { | ||
| include: ['vitest-canvas-mock'], | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| }) | ||
| ); |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.