Extract mocked function in a different package
See original GitHub issueHello 👋
I have been using babel to compile my typescript projects more and more lately, and the only reason why I am still installing ts-jest is because of the utils/mocked
function.
Would you consider extracting this util into its own package?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Mock only one function from module but leave rest with ...
mock ('package-name') makes all exported functions mocks, which I don't want. I tried spreading the named exports back into the mock object...
Read more >Mock Functions - Jest
Mock functions allow you to test the links between code by erasing the actual implementation of a function, capturing calls to the function...
Read more >How to mock specific module function? · Issue #936 - GitHub
I have a module. It exports multiple functions. Here is myModule.js: export function foo() {...} export function b...
Read more >Mocking different values for the same module using Jest
We've seen how to mock a module to export different values for different tests. When the export is a function, you can mock...
Read more >How To Mock Only One Function From A Module In Jest
I had a similar case where I was importing several different exports from a module @module/api and using it throughout my code. In...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, works for me! Looks useful
Would it be worth proposing to the Jest team to add it to the core package, especially now that Jest is written in TypeScript, or to https://github.com/jest-community?