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 jest.md #2499

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Update jest.md #2499

wants to merge 1 commit into from

Conversation

wyatt-troia
Copy link

Add note about skipping setting 'setupFilesAfterEnv' if using create-react-app. If you try to do so when using create-react-app, you get the following error:

(base) ➜  component-library git:(setup) ✗ npm run test

> component-library@0.1.0 test
> react-scripts test

We detected setupFilesAfterEnv in your package.json.

Remove it from Jest configuration, and put the initialization code in src/setupTests.js.
This file will be loaded automatically.

Add note about skipping setting 'setupFilesAfterEnv' if using create-react-app. If you try to do so when using create-react-app, you get the following error:

```
(base) ➜  component-library git:(setup) ✗ npm run test

> component-library@0.1.0 test
> react-scripts test

We detected setupFilesAfterEnv in your package.json.

Remove it from Jest configuration, and put the initialization code in src/setupTests.js.
This file will be loaded automatically.
```
@ljharb
Copy link
Member

ljharb commented Feb 5, 2021

Skipping this step means your enzyme adapter isn't configured. What's the workaround?

@ljharb ljharb added the docs label Feb 5, 2021
@codecov
Copy link

codecov bot commented Feb 5, 2021

Codecov Report

Merging #2499 (6017756) into master (cdfb1c6) will decrease coverage by 87.52%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #2499       +/-   ##
==========================================
- Coverage   96.12%   8.60%   -87.53%     
==========================================
  Files          49      16       -33     
  Lines        4004    1802     -2202     
  Branches     1123     498      -625     
==========================================
- Hits         3849     155     -3694     
- Misses        155    1647     +1492     
Impacted Files Coverage Δ
packages/enzyme/src/ShallowWrapper.js 4.57% <0.00%> (-94.49%) ⬇️
packages/enzyme/src/ReactWrapper.js 6.56% <0.00%> (-92.90%) ⬇️
packages/enzyme/src/RSTTraversal.js 7.27% <0.00%> (-90.00%) ⬇️
packages/enzyme/src/validateAdapter.js 10.00% <0.00%> (-90.00%) ⬇️
packages/enzyme-shallow-equal/src/index.js 11.76% <0.00%> (-88.24%) ⬇️
packages/enzyme/src/EnzymeAdapter.js 12.50% <0.00%> (-87.50%) ⬇️
packages/enzyme/src/Utils.js 7.72% <0.00%> (-87.13%) ⬇️
packages/enzyme/src/Debug.js 14.86% <0.00%> (-85.14%) ⬇️
packages/enzyme/src/configuration.js 18.18% <0.00%> (-81.82%) ⬇️
packages/enzyme/src/selectors.js 14.72% <0.00%> (-81.73%) ⬇️
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdfb1c6...6017756. Read the comment docs.

@ljharb ljharb marked this pull request as draft March 26, 2021 15:08
@ljharb ljharb force-pushed the master branch 3 times, most recently from 43eb75e to 39e6b1f Compare November 3, 2022 21:47
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 this pull request may close these issues.

None yet

2 participants