Skip to content

8.0.6 release breaks test in browser #414

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

Closed
jeetiss opened this issue Jul 26, 2019 · 1 comment · Fixed by #415
Closed

8.0.6 release breaks test in browser #414

jeetiss opened this issue Jul 26, 2019 · 1 comment · Fixed by #415
Labels

Comments

@jeetiss
Copy link
Contributor

jeetiss commented Jul 26, 2019

What you did:

I'm run test react components with @testing-library/react in puppeteer with karma

What happened:

after update to 8.0.6 test fails with:

HeadlessChrome 77.0.3844 (Mac OS X 10.14.6) ERROR
  Uncaught ReferenceError: require is not defined
  at test/index.js:18318:17
  
  ReferenceError: require is not defined
      at test/index.js:18318:17
      at test/index.js:40482:2

travis logs

with 8.0.5 tests works

Problem description:

  • before run test in browser i'm bundle them with rollup
  • rollup don't support mixed imports and require and don't bundle 'react-dom/test-utils'

Снимок экрана 2019-07-26 в 9 40 41

  • test fails because require not defined in browser

Suggested solution:

don't use mixed imports and require
https://github.com/testing-library/react-testing-library/blob/master/src/act-compat.js#L3-L5

or

put back try catch block
https://github.com/testing-library/react-testing-library/pull/407/files#diff-eed96c92b94e7db3aebd8867fb75ce2fL8

Relevant code or config:

karma config
test

Environment

  • react-testing-library version: 8.0.6
  • react version: 16.8.6
  • node version: 10
  • npm (or yarn) version: 1.17
@kentcdodds
Copy link
Member

🎉 This issue has been resolved in version 8.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants