From e24f48420d1ee9a8684d8ccfa6d01d7e7036f5ee Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 3 Dec 2019 23:16:51 +0100 Subject: Fix application testing (#113) --- src/main/kotlin/pl/treksoft/kvision/Application.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/kotlin/pl/treksoft') diff --git a/src/main/kotlin/pl/treksoft/kvision/Application.kt b/src/main/kotlin/pl/treksoft/kvision/Application.kt index 34d3e8cb..16354e9d 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Application.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Application.kt @@ -23,6 +23,7 @@ package pl.treksoft.kvision import pl.treksoft.kvision.panel.Root import kotlin.browser.document +import kotlin.browser.window /** * Base class for KVision applications. @@ -55,6 +56,8 @@ abstract class Application { * Main function for creating KVision applications. */ fun startApplication(builder: () -> Application) { + @Suppress("UnsafeCastFromDynamic") + if (window.asDynamic().__karma__) return fun start(state: dynamic): Application? { val application = builder() -- cgit