[go: up one dir, main page]

Skip to content

Commit

Permalink
Fix to run wasm test tasks in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xxfast committed Apr 28, 2024
1 parent 9b078eb commit 8280279
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,3 @@ allprojects {
koverMerged {
enable()
}


21 changes: 21 additions & 0 deletions kstore-storage/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -35,4 +37,23 @@ kotlin {
}
}

//
// TODO: https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0
// The following is required to support the wasmJs target.
//
// Node.js Canary is set to 21.0.0-v8-canary20231019bd785be450
// as that is the last version to ship Windows binaries too.
//

rootProject.extensions.configure<NodeJsRootExtension> {
nodeVersion = "21.0.0-v8-canary20231019bd785be450"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

rootProject.tasks.withType<KotlinNpmInstallTask>().configureEach {
val flag = "--ignore-engines"

if (!args.contains(flag)) {
args.add(flag)
}
}
23 changes: 23 additions & 0 deletions kstore/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -144,3 +146,24 @@ kotlin {
val windowsTest by getting
}
}

//
// TODO: https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0
// The following is required to support the wasmJs target.
//
// Node.js Canary is set to 21.0.0-v8-canary20231019bd785be450
// as that is the last version to ship Windows binaries too.
//

rootProject.extensions.configure<NodeJsRootExtension> {
nodeVersion = "21.0.0-v8-canary20231019bd785be450"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

rootProject.tasks.withType<KotlinNpmInstallTask>().configureEach {
val flag = "--ignore-engines"

if (!args.contains(flag)) {
args.add(flag)
}
}

0 comments on commit 8280279

Please sign in to comment.