-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Test: Add mock capabilities #31987
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
Test: Add mock capabilities #31987
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
37ac8d2
WIP
valentinpalkovic 539f149
Build-Mode: Module automocking manifest generation
valentinpalkovic 2fa1747
Support build mode for mocking
valentinpalkovic 74b1ea4
Support mocking in build and serve mode without msw
valentinpalkovic 09d0526
Invalidate mocks and affected files on change
valentinpalkovic ae7ccbb
Cleanup
valentinpalkovic 6ed46dc
Fix type assertion for global CHANNEL_OPTIONS
valentinpalkovic d421269
Merge remote-tracking branch 'origin/next' into valentin/storybook-mock
valentinpalkovic 507b895
Remove msw dependency
valentinpalkovic 452b1b1
Revert accidential addition of import
valentinpalkovic f3a7a3f
Fix build
valentinpalkovic 64db30c
Update lock file
valentinpalkovic b7f804d
Merge branch 'next' into valentin/storybook-mock
valentinpalkovic 51739bd
Dynamically load vite-based dependencies
valentinpalkovic 85da36e
Renamings
valentinpalkovic 94d6004
Renamings
valentinpalkovic 969c6b6
Further renamings
valentinpalkovic d0134d0
Remove unused imports
valentinpalkovic 2117325
Fix pnpm related issues where dependencies in virtual files cannot be…
valentinpalkovic 0be57b8
Readd storybook/test global
valentinpalkovic a6e7285
Ignore ts error due to wrong types
valentinpalkovic ddeb032
Finetune stories
valentinpalkovic 2d8331d
Simplify configuration
valentinpalkovic 0467d3d
Move storybook vitest config to root
valentinpalkovic 8a16325
Fix indentation
valentinpalkovic d8bfaf6
Merge remote-tracking branch 'origin/next' into valentin/storybook-mock
valentinpalkovic ba39684
Add telemetry
valentinpalkovic 7f9ccd1
Add E2E tests
valentinpalkovic 0200199
Optimize @vitest/spy dependency
valentinpalkovic 1bc7f56
Fix event checker
valentinpalkovic 2529308
Implement module mocking for Webpack
valentinpalkovic a7f833f
Update event log checker to find main event by event type when noBoot…
valentinpalkovic 8757901
Enable mocking E2E tests for all frameworks
valentinpalkovic ec1721e
Update package.json
valentinpalkovic ddcc52e
Refactor sandbox-parts.ts to always include mocking setup for Vitest …
valentinpalkovic 0d381f1
Add temporary resolution field for rollup
valentinpalkovic e5cd418
Adjust event-log-checker to consider mocking event
valentinpalkovic 91374d1
Don't setup mocks for bench sandboxes
valentinpalkovic e5b3b3b
Add rollup version resolution to package.json
valentinpalkovic 4bfdfee
Update sandbox task conditions to check for 'Bench' instead of 'bench'
valentinpalkovic c806bf0
Rewrite mock modules to be framework agnostic
valentinpalkovic 198b15c
Adjust sb-module-mocking e2e tests
valentinpalkovic f84e398
Fix mocking when preserveSymlink is true
valentinpalkovic c00e0c2
Refactor event-log-checker to exclude mocking events from log assertions
valentinpalkovic 368b902
Simplify mock stories
valentinpalkovic 6c006cf
Fix module mocking stories
valentinpalkovic c7b2846
Transform NodeModuleMocking into JavaScript
valentinpalkovic 77f6c71
Update storybook mock stories to use 'text' instead of 'object' for a…
valentinpalkovic 2770930
Fix Windows-related issues
valentinpalkovic 200c6d3
Change transform order in viteMockPlugin from 'post' to 'pre'
valentinpalkovic 1c0e813
Fix creation of react-webpack/prerelease-ts in linked mode
valentinpalkovic a5d24df
Implement watcher for mocking in Webpack-based projects
valentinpalkovic 5b4f063
Use babel for parsing mocks
valentinpalkovic 668f2d2
Improve error logging in viteMockPlugin to include error details
valentinpalkovic 6d5499b
Revert change
valentinpalkovic bb66c83
Support sb.mock(import(x), ...) syntax
valentinpalkovic 7ac5042
Use spyOn from storybook/test
valentinpalkovic f54c196
Use proper type for sb.mock
valentinpalkovic 4ecd08f
Remove unnecessary try/catch block
valentinpalkovic 88961b7
Add Todo comments
valentinpalkovic e47c289
Remove unnecessary code
valentinpalkovic d358bfc
Cleanup
valentinpalkovic 7f7556c
Merge branch 'next' into valentin/storybook-mock
valentinpalkovic 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function getTodos() { | ||
| return ['some todo']; | ||
|
Comment on lines
+1
to
+2
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Consider return type annotation |
||
| } | ||
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,3 @@ | ||
| export default { | ||
| VERSION: '1.0.0-mocked!', | ||
| }; |
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,5 @@ | ||
| function add(a, b) { | ||
| return 'mocked 3'; | ||
| } | ||
|
valentinpalkovic marked this conversation as resolved.
|
||
|
|
||
| export default add; | ||
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 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.
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.