如何 运行 eslint with mocha with watch 选项?
How to run eslint with mocha with watch option?
我想对 Mocha that I can with Karma+Webpack: Eslint 测试之前的代码做同样的事情,并在监视模式下执行此操作(监视文件的更改),因此 eslint+tests 将重新运行每次保存。
用 Karma 观看是这样的:Karma 有 autoWatch option, that watches files for changes. Eslint comes into picture because the client code that is tested with Karma is first processed with webpack which runs eslint on it (with eslint-loader).
Mocha 有 --watch 选项,因此我可以 mocha test --watch
重新运行文件更改测试。
Eslint 有 eslint-watch,所以我可以 esw test --watch
在文件更改时重新运行 eslint。
有mocha-eslint (needs configuration) and eslint-mocha(无需配置),两者都在测试中包含eslint,但没有watch选项,它们和运行 eslint test && mocha test
.[=19=一样好]
有什么东西没有引起我的注意吗?那里已经有现有的解决方案了吗?或者有解决办法吗?
提前致谢!
你可以试试concurrently。
concurrently "mocha test --watch" "esw test --watch"
我想对 Mocha that I can with Karma+Webpack: Eslint 测试之前的代码做同样的事情,并在监视模式下执行此操作(监视文件的更改),因此 eslint+tests 将重新运行每次保存。
用 Karma 观看是这样的:Karma 有 autoWatch option, that watches files for changes. Eslint comes into picture because the client code that is tested with Karma is first processed with webpack which runs eslint on it (with eslint-loader).
Mocha 有 --watch 选项,因此我可以 mocha test --watch
重新运行文件更改测试。
Eslint 有 eslint-watch,所以我可以 esw test --watch
在文件更改时重新运行 eslint。
有mocha-eslint (needs configuration) and eslint-mocha(无需配置),两者都在测试中包含eslint,但没有watch选项,它们和运行 eslint test && mocha test
.[=19=一样好]
有什么东西没有引起我的注意吗?那里已经有现有的解决方案了吗?或者有解决办法吗?
提前致谢!
你可以试试concurrently。
concurrently "mocha test --watch" "esw test --watch"