robstoll
04/17/2025, 6:51 AMdescribe("foo") {
context("bar") {
it("should add numbers correctly") {
assertEquals(4, 2 + 2)
}
}
}
external fun describe(name: String, block: () -> Unit)
external fun context(name: String, block: () -> Unit)
external fun it(name: String, block: () -> Unit)
Works in gradle but intellij does not pick it up correctly, i.e. not all tests are shown in the test view (it is picked up correctly in the build view though)Artem Kobzar
04/17/2025, 7:03 AMEdoardo Luppi
04/17/2025, 10:13 AMintellij's test viewWouldn't this require a specialized test reporter? Kotlin/JS has its own reporter for
kotlin.test
tests, but I don't think IJ will recognize you're running Mocha tests.robstoll
04/17/2025, 10:14 AMEdoardo Luppi
04/17/2025, 10:16 AMrobstoll
04/17/2025, 10:16 AM@Test
fun foo() {
describe("foo") {
context("bar") {
it("should add numbers correctly") {
assertEquals(4, 2 + 2)
}
}
}
}
Edoardo Luppi
04/17/2025, 10:17 AM@Test
annotated function was the missing piece of contextrobstoll
04/17/2025, 10:18 AMEdoardo Luppi
04/17/2025, 10:19 AMfoo
test case itself runs inside a Mocha it
, so you're basically creating a test suite inside of a test case.Edoardo Luppi
04/17/2025, 10:23 AMrobstoll
04/17/2025, 10:25 AMCLOVIS
04/17/2025, 12:17 PMrobstoll
04/17/2025, 12:18 PMCLOVIS
04/17/2025, 12:18 PMCLOVIS
04/17/2025, 12:18 PMCLOVIS
04/17/2025, 12:18 PMrobstoll
04/17/2025, 12:19 PMrobstoll
04/17/2025, 12:19 PMrobstoll
04/17/2025, 12:26 PMCLOVIS
04/17/2025, 12:26 PMCLOVIS
04/17/2025, 12:26 PMCLOVIS
04/17/2025, 12:27 PMrobstoll
04/17/2025, 12:27 PMCLOVIS
04/17/2025, 12:28 PMCLOVIS
04/17/2025, 12:30 PMrobstoll
04/17/2025, 12:30 PMCLOVIS
04/17/2025, 12:30 PMOliver.O
04/17/2025, 1:39 PMThe IDE does not report more than one level of suite nesting for tests using the Kotlin/JS infra (JS/Browser, JS/Node, Wasm/JS/Browser). While all suites appear, they are not properly nested, because the names of intermediate levels are cut out on their way from the test framework to the IDE.
robstoll
04/17/2025, 1:40 PMOliver.O
04/17/2025, 1:49 PMrobstoll
04/17/2025, 10:52 PMOliver.O
04/17/2025, 10:55 PM