-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat: add onGenerateMock transformer callback (#15429) #15433
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
ec88557
to
1e3405a
Compare
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.
this is awesome, thanks!
mind adding some docs in https://github.com/jestjs/jest/blob/main/docs/JestObjectAPI.md as well?
Sure |
1e3405a
to
b51c79d
Compare
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.
awesome, thank you!
Head branch was pushed to by a user without write access
* | ||
* @param cb | ||
*/ | ||
onGenerateMock<T>(cb: (moduleName: string, moduleMock: T) => T): Jest; |
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.
this is duplicated now, unless I'm seeing things 😅
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.
It seems rebase breaks 😃
6586efb
to
b709d31
Compare
Summary
Add ability to modify generated mock within presets or project code (Closes #15429, thymikee/jest-preset-angular#2908)
Test plan
Run test in
packages/jest-runtime/src/__tests__/runtime_mock.test.js