-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Unexpected character # #8497
Comments
You will have to configure Babel to transpile syntax that is not yet supported natively by Node, please check out the docs. |
This article (which predates this ticket) suggests that private fields are in-fact supported in the latest version of node. Indeed, I have tested it. I have created a class that has a private field and a method that returns it. I can print it to the console. Yet requiring it in a jest test throws a syntax error. |
Here's a small github project that demonstrates the issue. My node version is v12.4.0 |
This is essentially #6829, just another syntax. You'll need to configure babel or disable babel-jest for this to work |
Thank you @SimenB ! Setting |
@SimenB yeah, it works! Thanks :-D |
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
A clear and concise description of what the bug is.
I am using private fields in the class and it does not recognize the
#
To Reproduce
Steps to reproduce the behavior:
Expected behavior
should have know that this is private field name
A clear and concise description of what you expected to happen.
Link to repl or repo (highly encouraged)
Please provide either a repl.it demo or a minimal repository on GitHub.
https://repl.it/repls/CornsilkMidnightblueGenres
Issues without a reproduction link are likely to stall.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: