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

use es2015 syntax in mocha tests #1788

Merged
merged 4 commits into from
Dec 25, 2016
Merged

use es2015 syntax in mocha tests #1788

merged 4 commits into from
Dec 25, 2016

Conversation

marcobiedermann
Copy link
Contributor

use babel to use es2015 syntax in mocha tests

  • use import instead of require
  • use fat arrow => function instead of function() {} callback
  • use and let and const instead of var
  • use template stings instead of string concatenation

@chrislaughlin
Copy link

👍

@paulirish
Copy link
Member

Thanks for writing the PR.

I'd be interested in accepting this if its not dependent on babel. In my experience adding transpilation into your test runner makes debugging fairly painful.

If you want to confirm with node.green that all this stuff works in stable node 4.4 then let's just rip out the babel bit and ship it.

@marcobiedermann
Copy link
Contributor Author

@paulirish Thanks Paul for your comment.
As far as I know there is no other way than using a transpiler like Babel to use import state in JavaScript.
All other features: arrow functions, let, const and template strings are supported in Node 4.4+
The only solution dropping Babel would be to stick with require instead of import.

Do you know another way to get around this issue?

# Conflicts:
#	package.json
#	test/file_content.js
@marcobiedermann
Copy link
Contributor Author

@paulirish
I've merged the current master into my PR to keep it up to date.
I've also noticed that you already include Babel.js so we are good with using import in tests.

@roblarsen roblarsen merged commit 2ea87de into h5bp:master Dec 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants