How to run JS Karma tests from Gradle

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?

Answers


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

Need Your Help

asp.net value ' 1 ' is invalid

c# asp.net asp.net-mvc-5

I'm trying to work on asp.net mvc5 project where I have two models Post and Game.

How do I make a container div only overflow horizontally without using "display:inline-block" for its inner divs?

javascript css html overflow

I'm trying to create <div>s within another <div> at the click of a button. When the button is clicked, a new inner <div> is created (within the outer <div>) with a unique id...