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

document.createStyleSheet is not a function #130

Open
chrisheseltine opened this issue Aug 15, 2022 · 0 comments
Open

document.createStyleSheet is not a function #130

chrisheseltine opened this issue Aug 15, 2022 · 0 comments

Comments

@chrisheseltine
Copy link

I am using Jest to run smoke tests on my components using render() method from @testing-library/react. All my other tests pass except for the test that instantiates and renders the jvectormap (the wrapper component). I have tried multiple jest config solutions as well as jest config at top of file. Nothing works.

`Summary of all failing tests
FAIL src/components/WorldMapComponent.test.jsx
● renders without error

TypeError: document.createStyleSheet is not a function

  at Function.jvm.VMLElement.initializeVML (webpack:/@react-jvectormap/jvectormap/jquery.jvectormap.min.js?:745:12)
  at jvm.VMLCanvasElement.jvm.VMLElement [as constructor] (webpack:/@react-jvectormap/jvectormap/jquery.jvectormap.min.js?:696:20)
  at new jvm.VMLCanvasElement (webpack:/@react-jvectormap/jvectormap/jquery.jvectormap.min.js?:806:36)`

React v18, Node v18, create-react-app, jest, standardjs

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

1 participant