8

I'm not able to find any examples of Mocha or any other unit test framework running directly on ES6 code via Gulp. (No Babel, Webpack, etc.)

I've tracked down one example of Mocha (with some modification) running in a browser on ES6 code, but it was not automated.

Is anyone testing ES6 code directly yet?

(I understand this isn't the 'proper' format of an SO question, but I'm in the 'where do I start' phase here.)

Seanonymous
  • 1,304
  • 10
  • 30

2 Answers2

0

Mocha runs tests in Node.js, therefore you can use and test any es6 feature which is implemented in the node. Check out supported features for your node version:

https://node.green/

In the latest node you will get pretty good support for ES2015.

If you want to use ES6 modules, it still experimental feature and it can be enabled by flag (as of 2018): https://nodejs.org/api/esm.html#esm_ecmascript_modules

madox2
  • 49,493
  • 17
  • 99
  • 99
-3

I am not sure if your question is a valid one but it has triggered an unconventional response of not replying with code from me.

Check out this link for starters - https://ravichandranjv.blogspot.in/2018/03/mocha-testing-typescript-interfaces.html.

Disclaimer for others - This is not a self-promotion :)

user2347763
  • 469
  • 2
  • 10