From 8d97512179a23f11d9175fbdbd6e447ec78331e6 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 25 Jul 2018 14:41:01 +0300 Subject: [PATCH] [JS IR BE] Improve diagnostics in tests --- .../test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt | 2 +- js/js.translator/testData/_commonFiles/fail.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt index 47b21d386ef..b61ee084684 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/BasicIrBoxTest.kt @@ -115,7 +115,7 @@ abstract class BasicIrBoxTest( // TODO: should we do anything special for module systems? // TODO: return list of js from translateFiles and provide then to this function with other js files // TODO: cache runtime.js and don't cache kotlin.js for IR BE tests - super.runGeneratedCode(listOf(runtimeFile.path) + jsFiles, null, null, testFunction, expectedResult, false) + super.runGeneratedCode(listOf(runtimeFile.absolutePath) + jsFiles, null, null, testFunction, expectedResult, false) } } diff --git a/js/js.translator/testData/_commonFiles/fail.kt b/js/js.translator/testData/_commonFiles/fail.kt index ac818be21fb..f92fa7d90aa 100644 --- a/js/js.translator/testData/_commonFiles/fail.kt +++ b/js/js.translator/testData/_commonFiles/fail.kt @@ -3,5 +3,9 @@ package kotlin // see StdLibTestBase.removeAdHocAssertions fun fail(message: String? = null): Nothing { - throw Exception(message) + // TODO: replace with next version when exception is supported properly + // throw Exception(message) + + js("throw new Error(message)") + null!! } \ No newline at end of file