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

Number separator failing: Identifier directly after number #9768

Closed
amejiarosario opened this issue Apr 4, 2020 · 3 comments
Closed

Number separator failing: Identifier directly after number #9768

amejiarosario opened this issue Apr 4, 2020 · 3 comments

Comments

@amejiarosario
Copy link

🐛 Bug Report

From Node.js 12.5.0, there's support for Number separators. However, Jest doesn't seem to recognize it.

It returns this error:
Identifier directly after number

To Reproduce

Steps to reproduce the behavior:

Include a number separator in the code. E.g. const n = {1_000: 'Thousand'};.

image

Expected behavior

It should work without problems. I tried in the node.js console and it's working.

Link to repl or repo (highly encouraged)

Repo: amejiarosario/dsa.js-data-structures-algorithms-javascript@02034a3#diff-3599aee56da29942b69dc0f309f6f5ab

envinfo

  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.16.1 - ~/.asdf/installs/nodejs/12.16.1/bin/node
    npm: 6.14.4 - ~/Code/dsa.js/node_modules/.bin/npm
  npmPackages:
    jest: 25.2.7 => 25.2.7 
@jeysal
Copy link
Contributor

jeysal commented Apr 5, 2020

Hi, apparently Babel does not support the syntax by default yet. To fix this, you can either enable the corresponding Babel syntax plugin (see Babel docs) or disable the Babel transform (see Jest docs).

@jeysal jeysal closed this as completed Apr 5, 2020
@SimenB
Copy link
Member

SimenB commented Apr 5, 2020

babel/babel#7660 would have solved it as well

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants