You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set in your package.json, and you run an npm command with jest in it (e.g. "test": "jest"), you'll get:
ReferenceError: AbortController is not defined
This happens despite AbortController being available in Node v16.13.0.
Running code using AbortController without Jest works fine.
It seems CRA is changing Jest's node environment somehow?
I'm aware that CRA does not allow the "testEnvironment" setting to be set in the package.json when using react-scripts test. I simply did not expect setting the "testEnvironment" setting to its default ("node") to seemingly change the environment.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Description
If you have
set in your package.json, and you run an npm command with jest in it (e.g.
"test": "jest"
), you'll get:This happens despite
AbortController
being available in Node v16.13.0.Running code using
AbortController
without Jest works fine.It seems CRA is changing Jest's node environment somehow?
I'm aware that CRA does not allow the
"testEnvironment"
setting to be set in the package.json when usingreact-scripts test
. I simply did not expect setting the"testEnvironment"
setting to its default ("node"
) to seemingly change the environment.Environment
CRA v4.0.3
Node v16.13.0
npm v8.1.0
Steps to reproduce
and
"test": "jest",
in your package.jsonTo your package.json
npm test
I get the following output from that.
The text was updated successfully, but these errors were encountered: