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

Support es6 (import, async await etc) #62

Closed
yedidyak opened this issue Dec 19, 2016 · 6 comments
Closed

Support es6 (import, async await etc) #62

yedidyak opened this issue Dec 19, 2016 · 6 comments

Comments

@yedidyak
Copy link
Contributor

No description provided.

@rotemmiz
Copy link
Member

rotemmiz commented Dec 26, 2016

Supporting import natively in node (JS V8 engine to be precise) is probably never going to happen, just use require instead.
Supporting async await is coming really soon, already supported in V8 v5.5 (node 7.3 still uses V8 5.4, hopefully in the next release).

@rotemmiz
Copy link
Member

@yedidyak if you use node v7.1.0 and up you can add --harmony_async_await to your mocha.opts and it should do the async await magic.

@rotemmiz
Copy link
Member

rotemmiz commented Mar 6, 2017

new async await api is no in master, check out the test project. upcoming detox version (5.0.0) breaks the api completely in favor of async await.

Use node 7.6.0 and never babelify again.

@tackanoway35
Copy link

Why can't i use import syntax?

@rotemmiz
Copy link
Member

rotemmiz commented Feb 8, 2018

AFAIK it is still not supported natively in node: https://nodejs.org/api/esm.html#esm_unsupported

You can use import if you Babel your tests.

@lucassus
Copy link

Migrate your specs from mocha to jest and you'll be set ;)
It seems that jest has build-in support for es6 imports

@wix wix locked and limited conversation to collaborators Jul 23, 2018
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

5 participants