-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 token ... - is the spread operator supported? #2899
Comments
It's not really in Mocha's control one way or the other, as the only thing Mocha does about it is Most likely you'd need to review the difference between ES2015 and ESNext TypeScript modes, and Node 8's support (if any) for this specific usage of the spread operator, to make sure this isn't just expected behavior -- and if it should work, check the output to see if it's transpiled correctly (to determine whether the issue is on the TypeScript side or the Node side) and open an issue with the respective project. (Off the top of my head, my guess is that ES2015 vs. ESNext is the output version of JavaScript, meaning that ES2015 backports everything to work in environments that are only up to ES2015 features and ESNext assumes an up-to-date JS environment and does not backport anything; and based on Node 8 being able to use other versions of the spread operator but not object property assignment I suppose the latter may be defined in a newer version of the JS standard. But all that should be verified in documentation.) |
I am running Node 8.1.0, developing in TypeScript and setting the output to "EsNext".
Now, I can downgrade my TypeScript output to Es2015, and this problem goes away - but I'd really like to use the spread operator.
This is the offending code:
Mocha chokes on the spread operator.
Will this ever be a supported feature? What can I do to get mocha to run my program?
The text was updated successfully, but these errors were encountered: