I am trying to add a Gradle task to my project to run Karma tests. The tests have been run manually from command 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 command?
package.json
"scripts": {
"test-unit": "karma start test/unit/conf/karma.js"
}
build.gradle
apply plugin: 'node'
buildscript {
dependencies {
classpath 'com.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With