-
-
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
[Bug]: jest-runner Class private methods are not enabled with version 29.0.0 #13173
Comments
Why are you transpiling |
@SimenB I do not have jest-runner in my dependencies, it is installed by jest core library. I have a JS project |
It's babel that's complaining about the syntax, not Node itself. If you just do Do you have a reproduction I can check out? |
No, it is in my prod app, on a private repo. Is there any other info that might help you? Thanks for help |
Without a reproduction there's not much I can do. I'd take a look at your |
Ran into the same issue with React Native. Seems like {
"scripts": {
"test": "jest"
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"babel-jest": "^29.0.1",
"jest": "^29.0.1",
"metro-react-native-babel-preset": "^0.72.1"
},
"jest": {
"transformIgnorePatterns": []
}
}
{ "presets": ["module:metro-react-native-babel-preset"] }
import double from "./double";
test("Doubles the number", () => {
expect(double(2)).toBe(4);
});
// test/double.js
export default (value) => value * 2; As a workaround ignoring the already mentioned
|
Ah, nice 👍 that explains why our integration test doesn't fail: https://github.com/facebook/jest/blob/dde24c85698259d9ce887ede9646847d0fff9554/examples/react-native/jest.config.js#L7 Still, weird it triggers... I'll look into it next week 🙂 But yeah, don't transpile |
Right, transforming all Noticed that there is a
When that slash is removed |
Ah, that explains it (over-eager negation). Not sure there's anything for Jest to do? We target specific node versions - if other tooling has other syntax requirements that's not on Jest I think? |
I was able to successfully upgrade a React Native project with the error described here. Definitely nothing for Jest to do here as Edit: Some React Native packages also have to be transpiled because they are published with flow type annotations. |
Agreed, thanks! |
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. |
Version
29.0.0
Steps to reproduce
jest --runInBand
Expected behavior
Tests should run without errors
Actual behavior
I receive the following error:
Additional context
my jest config:
I do not get this error for versions 28.1.3 and 26.6.3
Environment
System: OS: macOS 12.5.1 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Binaries: Node: 18.8.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.18.0 - /usr/local/bin/npm npmPackages: jest: 29.0.0 => 29.0.0
The text was updated successfully, but these errors were encountered: