使用 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.

是否可以使用 Gradle 运行 Karma?google了一下,好像没找到解决办法.

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

谢谢

推荐答案

我通过在 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'
}

相关文章