diff --git a/buildSrc/src/main/kotlin/JsConfig.kt b/buildSrc/src/main/kotlin/JsConfig.kt index cb7a85f..8f2698a 100644 --- a/buildSrc/src/main/kotlin/JsConfig.kt +++ b/buildSrc/src/main/kotlin/JsConfig.kt @@ -16,39 +16,22 @@ */ import org.gradle.api.Project -import org.gradle.kotlin.dsl.the -import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinWasmJsTargetDsl -import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension inline fun KotlinJsTargetDsl.configJs( nodeJs: Boolean = true, - browser: Boolean = true, block: () -> Unit = {} ) { if (nodeJs) { - nodejs() -// { -//// testTask { -//// useMocha { -//// timeout = "10000" -//// } -//// } -// } - } - - if (browser) { - browser() -// { -// testTask{ -// useKarma { -// useChromeHeadless() -// // useConfigDirectory(File(project.rootProject.projectDir, "karma")) -// } -// } -// } + nodejs { + testTask { + useMocha { + timeout = "10000" + } + } + } } binaries.library() @@ -59,30 +42,24 @@ inline fun KotlinJsTargetDsl.configJs( fun Project.configJsTestTasks() { // val shouldRunJsBrowserTest = !hasProperty("teamcity") || hasProperty("enable-js-tests") // if (shouldRunJsBrowserTest) return - tasks.findByName("cleanJsBrowserTest")?.apply { - onlyIf { false } - } - tasks.findByName("jsBrowserTest")?.apply { - onlyIf { false } - } + // tasks.findByName("cleanJsBrowserTest")?.apply { + // onlyIf { false } + // } + // tasks.findByName("jsBrowserTest")?.apply { + // onlyIf { false } + // } } inline fun KotlinWasmJsTargetDsl.configWasmJs( nodeJs: Boolean = true, - browser: Boolean = true, block: () -> Unit = {} ) { if (nodeJs && isLinux) { // win in candy node `21.0.0-v8-canary202309143a48826a08` is not supported - // nodejs() - } - - if (browser) { - browser { - testTask{ - useKarma { - useChromeHeadless() - // useConfigDirectory(File(project.rootProject.projectDir, "karma")) + nodejs { + testTask { + useMocha { + timeout = "10000" } } } @@ -93,18 +70,17 @@ inline fun KotlinWasmJsTargetDsl.configWasmJs( } inline fun Project.configWasmJsTest(block: () -> Unit = {}) { - if (false) { - // see https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 - rootProject.the().apply { - // nodeVersion = "21.0.0-v8-canary202309143a48826a08" - version = "21.0.0-v8-canary202309143a48826a08" - downloadBaseUrl = "https://nodejs.org/download/v8-canary" - } - - tasks.withType().configureEach { - args.add("--ignore-engines") - } - } - + // if (false) { + // // see https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 + // rootProject.the().apply { + // // nodeVersion = "21.0.0-v8-canary202309143a48826a08" + // version = "21.0.0-v8-canary202309143a48826a08" + // downloadBaseUrl = "https://nodejs.org/download/v8-canary" + // } + // + // tasks.withType().configureEach { + // args.add("--ignore-engines") + // } + // } block() }