我正在尝试将Gradle任务添加到我的项目中以运行Karma测试。到目前为止,测试已从命令行手动运行。我发现了一个Gradle JS插件,但似乎没有Karma集成。除了从命令执行它们之外的任何解决方案
我正在尝试将Gradle任务添加到我的项目中以运行Karma测试。到目前为止,测试已从命令行手动运行。我发现了一个Gradle JS插件,但似乎没有Karma集成。除了从命令执行它们之外的任何解决方案
的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
的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