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

es6 without babel #2455

Closed
caperavensoftware opened this issue Aug 26, 2016 · 7 comments
Closed

es6 without babel #2455

caperavensoftware opened this issue Aug 26, 2016 · 7 comments
Labels
type: question support question

Comments

@caperavensoftware
Copy link

Are there any plans to start supporting es2015 code like import and export without the use of babel?

@ScottFreeCode
Copy link
Contributor

That's entirely up to the environment in which Mocha is run. I believe the latest versions of Node support just about all of ES2015 except the import/export module syntax; I don't know if or when that syntax is expected to be added to Node. Mocha doesn't have much say in these features one way or the other; it doesn't add core JavaScript functionality itself (except by integration of transpilers, and then it's up to the transpiler), and won't be able to do anything to block them once they're available either.

@caperavensoftware
Copy link
Author

ok so it's a node requirement then.
I am running the current latest version but the problems I am running into are in fact import and export. Thanks for the reply ScottFreeCode

@boneskull
Copy link
Contributor

@caperavensoftware You'll need to transpile. There are various ways to accomplish this. You could do babel-node /path/to/_mocha my-tests or mocha --require babel-register my-tests, etc, etc

@boneskull boneskull added the type: question support question label Sep 4, 2016
@SGD1953
Copy link

SGD1953 commented Sep 15, 2017

Is it worth considering to reopen this since nodejs does now support imports?

@boneskull
Copy link
Contributor

@SGD1953 I'm not sure why this would need to be reopened if there's native support. just use it

@boneskull
Copy link
Contributor

I'm nearly certain we allow experimental flags to pass through the mocha executable; someone make a bug if it doesn't work

@SGD1953
Copy link

SGD1953 commented Sep 28, 2017

I opened #3006 for this, apparent the situation is a bit more nuanced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question support question
Projects
None yet
Development

No branches or pull requests

4 participants