使用Gradle运行Karma? [英] Run Karma using Gradle?

查看:116
本文介绍了使用Gradle运行Karma?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想运行的Jasmine单元测试并获得伊斯坦布尔代码覆盖率报告。我可以运行一个命令行脚本来在Jenkins中运行Karma,但是使用我的build.gradle执行所有的事情会很好。

I have Jasmine unit tests that I would like to run and get Istanbul code coverage reports for. I can run a command line script to run Karma in Jenkins, but it would be nice to have everything execute using my build.gradle.

是否有可能使用Karma摇篮?我搜索了谷歌,但我似乎无法找到解决方案。

Is it possible to run Karma using Gradle? I've searched google, but I can't seem to find a solution.

谢谢

Thanks

推荐答案

我通过在build.gradle文件中创建并运行可执行任务来解决此问题:

I solved this by creating and running an executable task in the build.gradle file:

task karma(type:Exec) 
{
    commandLine 'karma', 'start', '--single-run true'
}

这篇关于使用Gradle运行Karma?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆