简体   繁体   English

使用babel-cli生成用于摩卡测试报告的JSON报告的脚本

[英]Script to generate JSON report for mocha test report while using babel-cli

I am using mocha and babel-cli and I am able to run mocha test using script 我正在使用摩卡咖啡和babel-cli,并且能够使用脚本运行摩卡咖啡测试

"mocha --compilers js:babel-core/register --recursive"

When I am not using babel I am able to generate the JSON report using script 我不使用 babel时,我可以使用脚本生成JSON报告

./node_modules/mocha/bin/mocha -R json> report 

Does anyone have solution(script) that how to get json report when using babel with mocha 有没有人有解决方案(脚本), 当在Mocha中使用babel时如何获取json报告

Here is the Script to get json report file for mocha test when using babel with es6 standard code. 这是在带有es6标准代码的babel上获取json报告文件以进行摩卡测试的脚本。

"./node_modules/mocha/bin/mocha -R json> report.json --require babel-core/register --recursive"

babel dependencies in package.json file - package.json文件中的babel依赖项-

  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1"
  } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM