Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Documenting how to use enzyme with react 16. Fixes #131. #143

Merged
merged 2 commits into from Jul 11, 2018
Merged

Documenting how to use enzyme with react 16. Fixes #131. #143

merged 2 commits into from Jul 11, 2018

Conversation

catchin
Copy link
Contributor

@catchin catchin commented May 7, 2018

As there has been some confusion how to include enzyme in #131 , I updated the README at this place. Let me know if something needs to be changed.

@ShawnXiao105
Copy link

@catchin I follow your pr to add react-test-renderer and enzyme-adapter-react-16 without use eject. npm test still fail.

The error message is the same as

These options in your package.json Jest configuration are not currently supported by Create React App:

  • setupTestFrameworkScriptFile

@catchin
Copy link
Contributor Author

catchin commented May 31, 2018

@ShawnXiao105 Can you share what steps you performed? I just created an app from scratch and it works. In this repo you see what steps I performed (as single commits) and what the code looks like: https://github.com/catchin/react-typescript-example-with-enzyme

Did you modify package.json to include a setupTestFrameworkScriptFile configuration? Because this is not necessary. Also, which version of react-scripts-ts do you use?

@ShawnXiao105
Copy link

ShawnXiao105 commented Jun 4, 2018

@catchin It works now. The reason is that I add JEST options in package.json. And I Remove jest > setupTestFrameworkScriptFile key in package.json and all thing is OK.

And I also reference this thread

@DanielRosenwasser
Copy link
Member

Thank you so much for the PR and thanks for your patience!

@DanielRosenwasser DanielRosenwasser merged commit b016ad1 into microsoft:master Jul 11, 2018
@catchin
Copy link
Contributor Author

catchin commented Jul 12, 2018

Thanks for merging!

@catchin catchin deleted the readme-enzyme branch July 12, 2018 04:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants