summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2021-08-13 01:30:12 +0200
committernea <romangraef@gmail.com>2021-08-13 01:30:12 +0200
commitb08f576aaaac1242a35a8b9d6dd7482a8124d732 (patch)
tree17eb19eff4b2bd19cb67c067e0f6307ae8986e7b
parent62d3fcb7500e623b8c4a1b79c2e271121c3ce794 (diff)
downloadwebos-b08f576aaaac1242a35a8b9d6dd7482a8124d732.tar.gz
webos-b08f576aaaac1242a35a8b9d6dd7482a8124d732.tar.bz2
webos-b08f576aaaac1242a35a8b9d6dd7482a8124d732.zip
use a javascript viable tester
-rw-r--r--.github/workflows/test.yml19
-rw-r--r--build.gradle.kts10
-rw-r--r--src/jsTest/kotlin/ProjectConfig.kt7
-rw-r--r--src/jsTest/kotlin/io/PathTest.kt47
4 files changed, 37 insertions, 46 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9d9bd00..f254cbe 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -13,28 +13,13 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 16
- - name: Get Allure history
- uses: actions/checkout@v2
- if: always()
- continue-on-error: true
- with:
- ref: gh-pages
- path: gh-pages
- name: Run Gradle Tests
- run: ./gradlew jsNodeTest --stacktrace
- - name: Generate Allure Report
- if: always()
- uses: simple-elf/allure-report-action@master
- with:
- allure_results: build/test-results/jsNodeTest
- allure_history: allure-history
-
-
+ run: ./gradlew jsTest --stacktrace
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
- PUBLISH_DIR: allure-history
+ PUBLISH_DIR: build/reports/test/jsTest
diff --git a/build.gradle.kts b/build.gradle.kts
index 06e8b90..b8e248f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
kotlin("multiplatform") version "1.5.21"
- //id("io.kotest.multiplatform") version "5.0.0.3"
+ id("io.kotest.multiplatform") version "5.0.0.3"
}
repositories {
@@ -14,7 +14,7 @@ kotlin {
targets {
js(IR) {
nodejs { }
- browser { }
+ browser { testTask { useMocha() } }
}
}
sourceSets {
@@ -23,9 +23,9 @@ kotlin {
}
val jsTest by getting {
dependencies {
- implementation("io.kotest:kotest-assertions-core:4.6.1")
- implementation("io.kotest:kotest-framework-api:4.6.1")
- implementation("io.kotest:kotest-framework-engine:4.6.1")
+ implementation("io.kotest:kotest-assertions-core:5.0.0.376-SNAPSHOT")
+ implementation("io.kotest:kotest-framework-api:5.0.0.376-SNAPSHOT")
+ implementation("io.kotest:kotest-framework-engine:5.0.0.376-SNAPSHOT")
}
}
}
diff --git a/src/jsTest/kotlin/ProjectConfig.kt b/src/jsTest/kotlin/ProjectConfig.kt
new file mode 100644
index 0000000..cf0f15d
--- /dev/null
+++ b/src/jsTest/kotlin/ProjectConfig.kt
@@ -0,0 +1,7 @@
+import io.kotest.core.config.AbstractProjectConfig
+
+class ProjectConfig : AbstractProjectConfig() {
+ override suspend fun beforeProject() {
+ println("HELLO")
+ }
+}
diff --git a/src/jsTest/kotlin/io/PathTest.kt b/src/jsTest/kotlin/io/PathTest.kt
index 2649a2a..73667a6 100644
--- a/src/jsTest/kotlin/io/PathTest.kt
+++ b/src/jsTest/kotlin/io/PathTest.kt
@@ -1,32 +1,31 @@
package io
-import io.kotest.core.spec.style.DescribeSpec
+import io.kotest.core.spec.style.FunSpec
+import io.kotest.matchers.booleans.shouldBeFalse
import io.kotest.matchers.types.shouldBeTypeOf
-class PathTest : DescribeSpec({
- describe("Path") {
- val homeDir = Path.of("/home") as Path.Absolute
- it("recognize relative paths as such") {
- listOf(
- Path.of("a/b"),
- Path.of("."),
- Path.of("a", "b"),
- Path.ofShell("a/b", userHome = homeDir),
- Path.ofShell(".", userHome = homeDir),
- Path.ofShell("a", "b", userHome = homeDir),
- Path.ofShell(listOf("a", "b"), userHome = homeDir),
- ).forEach {
- it.shouldBeTypeOf<Path.Relative>()
- }
+class PathTest : FunSpec({
+ val homeDir = Path.of("/home") as Path.Absolute
+ test("recognize relative paths as such") {
+ listOf(
+ Path.of("a/b"),
+ Path.of("."),
+ Path.of("a", "b"),
+ Path.ofShell("a/b", userHome = homeDir),
+ Path.ofShell(".", userHome = homeDir),
+ Path.ofShell("a", "b", userHome = homeDir),
+ Path.ofShell(listOf("a", "b"), userHome = homeDir),
+ ).forEach {
+ it.shouldBeTypeOf<Path.Relative>()
}
- it("recognize absolute paths as such") {
- listOf(
- Path.of("/a/b"),
- Path.of("/"),
- Path.ofShell("/b/c", userHome = homeDir),
- ).forEach {
- it.shouldBeTypeOf<Path.Absolute>()
- }
+ }
+ test("recognize absolute paths as such") {
+ listOf(
+ Path.of("/a/b"),
+ Path.of("/"),
+ Path.ofShell("/b/c", userHome = homeDir),
+ ).forEach {
+ it.shouldBeTypeOf<Path.Absolute>()
}
}
})