如何在用 Typescript 和 ES6 编写的 NodeJS 中运行 Cucumber 测试

Foy*_*any 5 javascript node.js typescript ecmascript-6 cucumberjs

运行用 Typescript 和 ES6 编写的 CucumberJS BDD 测试的正确方法是什么?

我想首先将 typescript 代码转译为 es6,然后使用 babel 将其转换为 es5。

在此输入图像描述

我可以从 npm test 运行它,例如 node_modules/.bin/babel-node node_modules/.bin/cucumber.js ./test/features 但如何添加 typescript 和 babel?有没有像 Karma 这样可以轻松与 Webpack 集成的后端测试运行器?