Skip to content

React spring is breaking my tests #555

@WebDeg-Brian

Description

@WebDeg-Brian

I'm currently using Jest with enzyme to test my components. My animations work fine on the client, no problems are shown in the console. However, when I run my tests, Jest keeps saying the problem comes from react-spring. Here are the screenshots:

https://cdn.discordapp.com/attachments/103696749012467712/547192480832159765/unknown.png
https://cdn.discordapp.com/attachments/103696749012467712/547192562851643402/unknown.png

I also confirm that because when I remove all the animations my tests work fine. As soon as I import Spring from react-spring the tests started to break :(
I believe this is a strong, and would appreciate if you could fix it as soon as possible. Thank you!

Edit: The problem most likely comes from the renderprops module, since I don't get the problem using hook

Edit again: I've read the this issue on GitHub and tried the workaround but doesn't seem to work. I then also tried to import the cjs file and it works, but it kinda sucks to import a CJS file instead of an actual ESM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions