Skip to content
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

_isomorphicDompurify.default.sanitize is not a function error in jest environment #141

Closed
Daggron opened this issue Aug 29, 2022 · 1 comment

Comments

@Daggron
Copy link

Daggron commented Aug 29, 2022

Whats the problem.

I am using ismorphic-dompurify in my application which uses RTL and jest for tests setup. When I am trying to run the component's tests which uses DOMPurify.sanitize from the library the tests environment throws an error as shown in screen shot below.

Screenshot 2022-08-29 at 9 27 58 PM

Can you guys help me with this ?

Our package versions for notable libraries are as follows

"isomorphic-dompurify" - 0.19.0 (because we need to support some applications which use node version equal to 12
"jest" - 26.1.0,
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^10.4.7",
"@testing-library/react-hooks": "^3.4.1",

@Daggron Daggron closed this as completed Aug 31, 2022
@kkomelin
Copy link
Owner

kkomelin commented Aug 31, 2022

Hi @Daggron ,
Thanks for reporting this issue. And sorry for not being able to react on it promptly.
Could you please provide a piece of code in which you import the library? you import or require statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants