-
Notifications
You must be signed in to change notification settings - Fork 3
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
TS & Jest mocks #1
Comments
Hi @embiem, thanks for the feedback! I've tested the solution proposed in my blog post and it seemed to work fine. I tested in two ways: Using create-react-app with TSI created a fresh install of create-react-app with TS running:
And I created two examples: That's the output of the tests: In this test I used TypeScript v3.7.5. Using react-boilerplate-typescriptSince the first test worked fine, I thought the issue might be related to the usage of ts-jest. So I also created a branch using the react-boilerplate-typescript that someone mentioned in the thread. With the same two examples: And got the same results: Things to checkMake sure you have Let me know if you find what I'm missing here! Thanks |
You're right, it does work. I'm honestly not 100% sure why it didn't work back when I posted this issue. I remember that I tried your approach, which didn't work at the time, then came across the solution using Thanks for taking the time to double-check this! |
Nice Blog!
I recently came across your blog as it was top google search result for
jest mockimplementation typescript
. Specifically this page: https://klzns.github.io/how-to-use-type-script-and-jest-mocksThis didn't work for me in current TS version, but this did work: kulshekhar/ts-jest#576 (comment)
Maybe you'd consider updating the post as it is first result in Google searches?
Cheers!
The text was updated successfully, but these errors were encountered: