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

查看:20
本文介绍了使用 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'
}

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

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