| plugins { |
| id "com.moowork.node" version "1.2.0" |
| } |
| |
| description = 'Kotlin-test integration tests for JS' |
| |
| apply plugin: 'kotlin-platform-js' |
| |
| dependencies { |
| compile project(':kotlin-test:kotlin-test-js') |
| } |
| |
| // package.json contains direct links to the builddir |
| buildDir = "$projectDir/build" |
| |
| [compileKotlin2Js, compileTestKotlin2Js]*.configure { |
| kotlinOptions.moduleKind = "commonjs" |
| } |
| |
| task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { |
| from compileKotlin2Js.destinationDir |
| |
| configurations.testCompile.each { |
| from zipTree(it.absolutePath).matching { include '*.js' } |
| } |
| |
| into "${buildDir}/node_modules" |
| } |
| |
| node { |
| download = true |
| } |
| |
| task testJest(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { |
| args = ['run', 'test-jest'] |
| execOverrides { |
| it.standardOutput = new FileOutputStream("$buildDir/test-jest.log") |
| it.errorOutput = new FileOutputStream("$buildDir/test-jest.err.log") |
| } |
| } |
| |
| task testJasmine(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { |
| args = ['run', 'test-jasmine'] |
| execOverrides { |
| it.standardOutput = new FileOutputStream("$buildDir/test-jasmine.log") |
| } |
| } |
| |
| task testMocha(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { |
| args = ['run', 'test-mocha'] |
| execOverrides { |
| it.standardOutput = new FileOutputStream("$buildDir/test-mocha.log") |
| } |
| } |
| |
| task testQunit(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { |
| args = ['run', 'test-qunit'] |
| execOverrides { |
| it.standardOutput = new FileOutputStream("$buildDir/test-qunit.log") |
| } |
| } |
| |
| task testTape(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { |
| args = ['run', 'test-tape'] |
| execOverrides { |
| it.standardOutput = new FileOutputStream("$buildDir/test-tape.log") |
| } |
| } |
| |
| [testJest, testJasmine, testMocha, testQunit, testTape].each { |
| check.dependsOn it |
| it.group = "verification" |
| } |