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 badges1 Answer
Reset to default 13package.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