-
Notifications
You must be signed in to change notification settings - Fork 69
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
3.0.1 doesn't work with Jest #96
Comments
Yes. Please check if the Jest section in https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c answers the use case? (linked from https://github.com/d3/d3-interpolate/releases/tag/v3.0.0). |
@Fil thank you for the hint. If anyone stumbles upon this issue, the specific solution that works for me is: // jest.config.js
moudle.exports = {
<other_configs_in_this_file>,
transformIgnorePatterns: [
'/node_modules/(?!d3-(interpolate|color))',
],
}; In particular beware that if you try only |
I'm also seeing this:
I tried your suggestion @slaweet but it makes no difference. I'm putting the config in craco.config.js because I'm using create-react-app:
|
Forgot to add that my project is written in Typescript including the Jest tests. |
Fixed it. Just had to move the jest config into package.json:
|
hi! I still have this problem, but this time use ant design and running jest. ` Details:
Thanks for any hint! By the way, the other solutions did not help me. |
same here @matiasfacio do you have any fix? |
I kind of found a workaround for my case. I am using ant-design which uses 3d. I mocked the imports of the components using the library in the test file that was throwing the error... shame on me, but couldn't do it otherwise. jest.mock('@ant-design/plots', () => ({ |
any solution? still problematic |
I ran into this as well. Project initially was: CRA, TS, Nivo, Chakra, Jest Then, WIP, Craco -> Vite. Here's what solve it for me:
|
I also got error like this
and solved this by adding
and it was solved! Actually, I got error towards these 5 modules, so I added them all to the
I got this error when I upgraded
and lots more! |
Orz ` ● Test suite failed to run
node_modules/element-ui/lib/theme-chalk/base.css:1`
node_modules/element-ui/lib/theme-chalk/base.css:1` |
When trying to upgrade d3-interpolate 2.0.1 -> 3.0.1, my Jest tests fail with:
Using node v14.15.4
The text was updated successfully, but these errors were encountered: