Use karma plugin to run kotlin-stdlib-js tests.
Also create html page to run tests interactively in browser. Use karma-teamcity-reporter 0.1.2 to workaround https://github.com/karma-runner/karma-teamcity-reporter/issues/38
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.craigburke.karma' version '1.4.4'
|
||||||
|
}
|
||||||
|
|
||||||
description = 'Kotlin Standard Library for JS'
|
description = 'Kotlin Standard Library for JS'
|
||||||
|
|
||||||
apply plugin: 'kotlin2js'
|
apply plugin: 'kotlin2js'
|
||||||
@@ -11,6 +15,8 @@ def jsSrcDir = "${jsLibrariesDir}/src"
|
|||||||
def jsTestSrcDir = "${jsLibrariesDir}/test"
|
def jsTestSrcDir = "${jsLibrariesDir}/test"
|
||||||
def jsSrcJsDir = "${jsSrcDir}/js"
|
def jsSrcJsDir = "${jsSrcDir}/js"
|
||||||
def jsOutputFile = "${buildDir}/classes/kotlin.js"
|
def jsOutputFile = "${buildDir}/classes/kotlin.js"
|
||||||
|
def jsTestOutputFile = "${buildDir}/classes/test/kotlin-stdlib-js_test.js"
|
||||||
|
def kotlinTestJsOutputFile = "${project(':kotlin-test:kotlin-test-js').buildDir}/classes/main/kotlin-test.js"
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
builtinsFiles {
|
builtinsFiles {
|
||||||
@@ -207,4 +213,31 @@ artifacts {
|
|||||||
archives mergedJar
|
archives mergedJar
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
karma {
|
||||||
|
dependencies(['qunitjs@1.23.1', 'karma-teamcity-reporter@0.1.2'])
|
||||||
|
|
||||||
|
frameworks = ['qunit']
|
||||||
|
browsers = ['PhantomJS']
|
||||||
|
|
||||||
|
if (project.hasProperty("teamcity")) {
|
||||||
|
reporters = ['teamcity']
|
||||||
|
}
|
||||||
|
|
||||||
|
profile('default') {
|
||||||
|
libraryBases = ['']
|
||||||
|
libraryFiles = [jsOutputFile, kotlinTestJsOutputFile]
|
||||||
|
|
||||||
|
sourceBases = []
|
||||||
|
sourceFiles = []
|
||||||
|
|
||||||
|
testBases = ['']
|
||||||
|
testFiles = [jsTestOutputFile]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
karmaGenerateConfig.outputs.upToDateWhen { false }
|
||||||
|
karmaRun.dependsOn testClasses
|
||||||
|
clean.dependsOn karmaClean
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Kotlin Standard Library Test Suite</title>
|
||||||
|
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||||
|
|
||||||
|
<!-- paths are setup for local file run -->
|
||||||
|
<!-- run karmaDependencies gradle task to fetch qunit -->
|
||||||
|
|
||||||
|
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||||
|
<script src="../build/classes/kotlin.js"></script>
|
||||||
|
<script src="../../../kotlin.test/js/build/classes/main/kotlin-test.js"></script>
|
||||||
|
<script src="../build/classes/test/kotlin-stdlib-js_test.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="qunit"></div>
|
||||||
|
<div id="qunit-fixture"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user