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

Update package.json settings in README #333

Closed
wants to merge 1 commit into from

Conversation

@apennell
Copy link

apennell commented Jan 14, 2020

The syntax in the current README, specifying what to add to package.json, isn't valid json syntax and doesn't match the addition suggested in the blog post. This updates the documentation here to align with the blog post.

The syntax in the current README, specifying what to add to package.json, is incorrect json syntax and doesn't match the addition [suggested in the blog post](https://formidable.com/blog/2018/assertions-and-testing-with-enzyme-matchers-6/). This updates the documentation here to align with the blog post.
@@ -19,7 +19,8 @@ If you prefer not to use the environment, you can also do this:
```js
// package.json
"jest": {
"setupFilesAfterEnv": ['./node_modules/jest-enzyme/lib/index.js'],
"testEnvironment": "enzyme",

This comment has been minimized.

Copy link
@ljharb

ljharb Jan 14, 2020

Contributor

is this something jest supports natively? i'd be very surprised to discover that's the case; it's far more likely that the repo is correct than a 2 year old blog post is.

This comment has been minimized.

Copy link
@apennell

apennell Jan 14, 2020

Author

I'm not sure. I was more concerned with the other line being correct because it tripped me up. Looking back at the history, though, I see that the syntax on that was changed a year ago to what it is currently. It says that setupTestFrameworkScriptFile was deprecated so that's why it was replaced with setupFilesAfterEnv but not why the path was changed to the array. I'll see if I can get it working using that after all.

This comment has been minimized.

Copy link
@ljharb

ljharb Jan 14, 2020

Contributor

it's likely that jest's format has changed; can you confirm in jest's docs?

This comment has been minimized.

Copy link
@apennell

apennell Jan 14, 2020

Author

Yeah actually I was trying to get this to work on a project that's using an older version of Jest, so I'm thinking that it should work as the docs state once we get that update. Will close out.

@apennell

This comment has been minimized.

Copy link
Author

apennell commented Jan 14, 2020

Looks like this should work with updated Jest

@apennell apennell closed this Jan 14, 2020
@apennell apennell deleted the apennell:patch-1 branch Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.