ES6 unit testing without compilation

馋奶兔 提交于 2019-12-05 08:32:35

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

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 :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!