-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Jest using incorrect dependency in JSDOM (Node deps not browser deps) #11139
Comments
You can use a custom resolver. |
CRA doesn't support specifying the option without ejecting.. When I do eject and use |
hah, the example in our docs doesn't work. You'll need to do // resolver.js
'use strict';
const browserResolve = require('browser-resolve');
module.exports = browserResolve.sync; then have |
That gives me this error:
Guessing it's something to do with how CRA is setup? Forgot to say this is the same issue I think #1909 |
Yeah, it's ESM, you need either Babel/ts-jest or https://jestjs.io/docs/en/ecmascript-modules |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
For context I have raised this issue in CRA and firebase but I think it is actually a jest issue.
firebase/firebase-js-sdk#4552
facebook/create-react-app#10626
As you can see from the comments in firebase/firebase-js-sdk#4552
it seems that Jest is loading in the Node binaries instead of the browser binaries. I have seen in earlier versions of Jest there was a --browser commands, and similar issues refer to this as the fix but that is no longer supported/not available in CRA.
To Reproduce
npx create-react-app test --template typescript
npm i firebase
npm run test
Expected behavior
The test should run and pass as expected
envinfo
The text was updated successfully, but these errors were encountered: