最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to run JS Karma tests from Gradle - Stack Overflow

programmeradmin2浏览0评论

I am trying to add a Gradle task to my project to run Karma tests. The tests have been run manually from mand line so far. I found a Gradle JS plugin but it doesn't seem to have Karma integration. Any solution besides executing them from a mand?

I am trying to add a Gradle task to my project to run Karma tests. The tests have been run manually from mand line so far. I found a Gradle JS plugin but it doesn't seem to have Karma integration. Any solution besides executing them from a mand?

Share Improve this question edited Oct 6, 2015 at 23:03 Chase Sandmann 5,0053 gold badges33 silver badges45 bronze badges asked Mar 11, 2014 at 21:00 Giovanni BottaGiovanni Botta 9,8166 gold badges54 silver badges95 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 13

package.json

"scripts": {
   "test-unit": "karma start test/unit/conf/karma.js"
}

build.gradle

apply plugin: 'node'

buildscript {
    dependencies {
        classpath '.moowork.gradle:gradle-node-plugin:0.4'
    }
}



// javascript unit testing
task testUnit(type: NpmTask) {
    args = ['run', 'test-unit']

}
//include js unit tests into project build lifecycle
test.dependsOn testUnit
发布评论

评论列表(0)

  1. 暂无评论