-
Notifications
You must be signed in to change notification settings - Fork 174
Migrate testing setup from Jest to Vitest #3261
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 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
eb40a1e
Initial plan
Copilot a6a90be
Replace Jest with Vitest dependencies and configuration
Copilot 2ca1928
Update test files to use Vitest API and create working configuration
Copilot 48c80dd
Complete Jest to Vitest migration with final configuration and docume…
Copilot fa7e37d
Update lockfile
RichDom2185 ecde3b4
Reformat files
RichDom2185 008ba16
Fix test config
RichDom2185 1ea160f
Remove old jest config
RichDom2185 be108af
Update dependencies
RichDom2185 aeb0665
Resolve import inconsistency
RichDom2185 5477538
Deduplicate dependencies
RichDom2185 5953417
Rename test files
RichDom2185 c17daed
Rename snapshots
RichDom2185 39a0d47
Update some test snapshots
RichDom2185 22114e2
Update more test snapshots
RichDom2185 10fe64d
Move past fixes to test setup
RichDom2185 bb636b1
Remove unnecessary reference types
RichDom2185 9f109ef
Fix some tests
RichDom2185 9e07a15
Update remaining snapshots
RichDom2185 1cf6e5c
Fix more tests
RichDom2185 dcc4f86
Fix navigation bar tests
RichDom2185 9210454
Fix some type errors
RichDom2185 04d6c27
Fix more type errors
RichDom2185 b9920f5
Update test snapshot
RichDom2185 83035c6
Update scripts
RichDom2185 50b75e8
Fix more tests
RichDom2185 002ed03
Reformat files
RichDom2185 b4dea5c
Remove double test suffix
RichDom2185 311bd36
Fix version
RichDom2185 8a05c15
Prevent opening browser UI on test launch
RichDom2185 4256067
Fail test early on CI
RichDom2185 4b817ff
Fix remaining errors
RichDom2185 bf75c60
Fix more tests and snapshots
RichDom2185 0a65a36
Fix ESLint issues
RichDom2185 6a20644
Configure i18next for tests
RichDom2185 2638e41
Fix coverage generation
RichDom2185 1be229b
Remove comment
RichDom2185 34e5020
Resolve imports
RichDom2185 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
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 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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s__/__snapshots__/ContentDisplay.tsx.snap → ..._snapshots__/ContentDisplay.test.tsx.snap
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
2 changes: 1 addition & 1 deletion
2
...__tests__/__snapshots__/Markdown.tsx.snap → ...ts__/__snapshots__/Markdown.test.tsx.snap
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 { useTypedSelector } from 'src/commons/utils/Hooks'; | ||
| import { shallowRender } from 'src/commons/utils/TestUtils'; | ||
| import { Mock, vi } from 'vitest'; | ||
|
|
||
| import Application from '../Application'; | ||
|
|
||
| vi.mock('react-redux', () => ({ | ||
| useDispatch: vi.fn(), | ||
| useSelector: vi.fn() | ||
| })); | ||
| const useSelectorMock = useTypedSelector as Mock; | ||
|
|
||
| test('Application renders correctly', () => { | ||
| useSelectorMock.mockReturnValue({ name: 'Bob' }); | ||
|
|
||
| const app = <Application />; | ||
| const tree = shallowRender(app); | ||
| expect(tree).toMatchSnapshot(); | ||
| }); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ests__/__snapshots__/Application.tsx.snap → ..._/__snapshots__/Application.test.tsx.snap
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.
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.