File tree 5 files changed +15
-22
lines changed
jsTest/kotlin/io/kotest/examples/js
5 files changed +15
-22
lines changed Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
2
+
1
3
plugins {
2
4
alias(libs.plugins.kotlin.multiplatform)
3
5
alias(libs.plugins.kotest.multiplatform)
@@ -13,30 +15,21 @@ kotlin {
13
15
js(IR ) {
14
16
nodejs()
15
17
}
18
+ compilerOptions {
19
+ apiVersion = KotlinVersion .KOTLIN_2_1
20
+ languageVersion = KotlinVersion .KOTLIN_2_1
21
+ }
16
22
sourceSets {
17
- val jsMain by getting {
23
+ jsMain {
18
24
dependencies {
19
25
implementation(libs.ktor.client.js)
20
26
}
21
27
}
22
- val jsTest by getting {
28
+ jsTest {
23
29
dependencies {
24
30
implementation(libs.kotest.assertions.core)
25
31
implementation(libs.kotest.framework.engine)
26
32
}
27
33
}
28
34
}
29
35
}
30
-
31
- tasks.withType< org.jetbrains.kotlin.gradle.dsl.KotlinCompile <* >>().configureEach {
32
- kotlinOptions {
33
- freeCompilerArgs = freeCompilerArgs + " -Xopt-in=kotlin.RequiresOptIn"
34
- }
35
- }
36
-
37
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
38
- kotlinOptions {
39
- apiVersion = " 1.9"
40
- verbose = true
41
- }
42
- }
Original file line number Diff line number Diff line change 1
1
[versions ]
2
- kotlin = " 2.0 .0"
3
- kotest = " 5.10.0-LOCAL "
4
- ktor = " 2.3.4 "
2
+ kotlin = " 2.1 .0"
3
+ kotest = " 5.9.1 "
4
+ ktor = " 2.3.7 "
5
5
6
6
[libraries ]
7
7
kotest-assertions-core = { module = " io.kotest:kotest-assertions-core" , version.ref = " kotest" }
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =wrapper/dists
3
- distributionUrl =https\://services.gradle.org/distributions/gradle-8.7 -bin.zip
3
+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.12.1 -bin.zip
4
4
networkTimeout =10000
5
5
validateDistributionUrl =true
6
6
zipStoreBase =GRADLE_USER_HOME
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import io.ktor.client.statement.*
5
5
6
6
private val client = HttpClient (Js )
7
7
8
- suspend fun fetch (): Dog {
8
+ suspend fun fetchDogUsingHttpClient (): Dog {
9
9
val resp = client.get(" https://dog.ceo/api/breeds/image/random" )
10
10
var message = " "
11
11
var status = " "
Original file line number Diff line number Diff line change 1
1
package io.kotest.examples.js
2
2
3
- import fetch
3
+ import fetchDogUsingHttpClient
4
4
import io.kotest.core.spec.style.FunSpec
5
5
import io.kotest.matchers.string.shouldEndWith
6
6
7
7
class DogTest : FunSpec ({
8
8
test("fetching a dog using JS promises") {
9
- fetch ().message.shouldEndWith(".jpg")
9
+ fetchDogUsingHttpClient ().message.shouldEndWith(".jpg")
10
10
}
11
11
})
You can’t perform that action at this time.
0 commit comments