简体   繁体   English

在Brunch.io中,我们如何运行测试

[英]In Brunch.io, how do we run tests

In an application generated by Brunch.io, how do we run tests? 在Brunch.io生成的应用程序中,我们如何运行测试? I would like to run them via the command line. 我想通过命令行运行它们。

For eg., the todos application has quite exhaustive test coverage. 例如, todos应用程序具有非常详尽的测试覆盖率。 But its Cakefile is empty. 但它的Cakefile是空的。 When I run 'cake test', it doesn't do anything. 当我进行'蛋糕测试'时,它什么也没做。 Can someone please point me in the right direction on the setup work needed to run the tests (either on command line or on browser)? 有人可以指出我在正确的方向上运行测试所需的设置工作(在命令行或浏览器上)?

Currently there is no official way to run tests in brunch 0.9. 目前没有正式的方法在早午餐0.9中运行测试。

But brunch 1.0 will introduce full support of testing with Mocha and cakefiles. 但早午餐1.0将引入对Mocha和cakefiles测试的全面支持。

So you're doing the right thing. 所以你做的是正确的。

Look at coffee-purist-brunch : 看看咖啡纯正早午餐

With this skeleton, run npm test instead of brunch test or npm start in addition to brunch watch in order to automatically run tests. 使用此骨架,除了brunch watch之外,还要运行npm test而不是brunch testnpm start ,以便自动运行测试。 This runs the tests directly on the coffeescript files in test/ and utilizes NPM-installed test libraries instead of static ones from test/vendor/ as other skeletons do. 这直接在test/的coffeescript文件上运行测试,并使用NPM安装的测试库而不是test/vendor/的静态测试库,就像其他骷髅一样。

And brunch-dutch-baby uses Karma. 早午餐 - 荷兰婴儿使用Karma。

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

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