Error when used in Jest #28
-
Are there any suggestions for avoiding issues when testing components that get or set cookies? I'm getting an error that i'm not sure how to address since most solutions involve simply setting the testing environment to jsdom to accommodate
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello |
Beta Was this translation helpful? Give feedback.
-
@insuusvenerati did you find a solution? |
Beta Was this translation helpful? Give feedback.
Hello
I think, you need to fully mock the package. You can write your own logic for storing/setting/getting/removing test cookies in a global object.
https://jestjs.io/docs/manual-mocks#mocking-node-modules