Skip to content

Instantly share code, notes, and snippets.

@chalisegrogan
Created June 6, 2017 17:23
Show Gist options
  • Select an option

  • Save chalisegrogan/712864c826ccf334a5ffa3af9815e326 to your computer and use it in GitHub Desktop.

Select an option

Save chalisegrogan/712864c826ccf334a5ffa3af9815e326 to your computer and use it in GitHub Desktop.
JSDom issue with running Jest tests

When running tests in Jest (with the following dependencies: jest, babel-jest, react-test-renderer), kept getting the following error:

Test suite failed to run

    TypeError: require(...).evalVMScript is not a function
      
      at JSDOMEnvironment.runScript (node_modules/jest-environment-jsdom/build/index.js:56:31)

This exact issue popped up in: https://github.com/jonboiser/wallaby-jest-problem. The author was able to figure out this being a problem potentially with conflicting issues of JSDOM.

If you're using the react test renderer, you don't need JSDOM. Run jest tests with:

jest --env=node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment