Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Experimental K2 JS support for nesting at all levels #36

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotest.multiplatform)
}

repositories {
Expand All @@ -18,28 +10,19 @@ repositories {
}

kotlin {
targets {
js(IR) {
browser {
testTask {
useMocha()
}
}
binaries.executable()
}
js(IR) {
nodejs()
}
sourceSets {
val jsMain by getting {
dependencies {
implementation(libs.ktor.client.js)
implementation(libs.ktor.client.js)
}
}
val jsTest by getting {
dependencies {
implementation(libs.kotest.assertions.core)
implementation(libs.kotest.framework.engine)
implementation(libs.kotest.framework.datatest)
implementation(libs.kotest.property)
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[versions]
kotlin = "1.9.10"
kotest = "5.7.2"
kotlin = "2.0.0"
kotest = "5.10.0-LOCAL"
ktor = "2.3.4"

[libraries]
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-framework-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
kotest-framework-datatest = { module = "io.kotest:kotest-framework-datatest", version.ref = "kotest" }
kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" }

ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
}
}
23 changes: 0 additions & 23 deletions src/jsTest/kotlin/io/kotest/examples/js/PropertyTests.kt

This file was deleted.

16 changes: 12 additions & 4 deletions src/jsTest/kotlin/io/kotest/examples/js/SsnTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ package io.kotest.examples.js

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import kotlinx.coroutines.delay
import validateSocial

class SsnTest : FunSpec({

test("a SSN should be invalid when it contains a zero in any position") {
validateSocial("543-23-5013") shouldBe false
validateSocial("043-23-5313") shouldBe false
validateSocial("313-03-5310") shouldBe false
context("js now allows nested tests") {
delay(1000) // look ma, I can use coroutines here !
context("give me another context!") {
delay(1000) // look ma, I can use coroutines here !
test("a SSN should be invalid when it contains a zero in any position") {
delay(1000) // look ma, I can use coroutines here too !
validateSocial("543-23-5013") shouldBe false
validateSocial("043-23-5313") shouldBe false
validateSocial("313-03-5310") shouldBe false
}
}
}

test("a SSN should be invalid when it starts with 666") {
Expand Down
35 changes: 0 additions & 35 deletions src/jsTest/kotlin/io/kotest/examples/js/datatest.kt

This file was deleted.

3 changes: 3 additions & 0 deletions src/jsTest/kotlin/io/kotest/js/config.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.kotest.js

fun config() {}