[Gradle, JS] Add test for KT-51801
This commit is contained in:
committed by
Space
parent
ba797fa1b4
commit
554470c462
+24
@@ -302,6 +302,30 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DisplayName("incremental compilation with multiple js modules after compilation error works")
|
||||||
|
@GradleTest
|
||||||
|
fun testIncrementalCompilationWithMultipleModulesAfterCompilationError(gradleVersion: GradleVersion) {
|
||||||
|
project("kotlin-js-ir-ic-multiple-artifacts", gradleVersion) {
|
||||||
|
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
|
||||||
|
build("compileKotlinJs")
|
||||||
|
|
||||||
|
val libKt = subProject("lib").kotlinSourcesDir().resolve("Lib.kt") ?: error("No Lib.kt file in test project")
|
||||||
|
val appKt = subProject("app").kotlinSourcesDir().resolve("App.kt") ?: error("No App.kt file in test project")
|
||||||
|
|
||||||
|
libKt.modify { it.replace("fun answer", "func answe") } // introduce compilation error
|
||||||
|
buildAndFail("compileKotlinJs")
|
||||||
|
libKt.modify { it.replace("func answe", "fun answer") } // revert compilation error
|
||||||
|
appKt.modify { it.replace("Sheldon:", "Sheldon :") } // some change for incremental compilation
|
||||||
|
build("compileKotlinJs", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {
|
||||||
|
assertOutputContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE)
|
||||||
|
assertTasksUpToDate(":lib:compileKotlinJs")
|
||||||
|
assertTasksExecuted(":app:compileKotlinJs")
|
||||||
|
assertCompiledKotlinSources(listOf(appKt).relativizeTo(projectPath), output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@DisplayName("builtins are loaded")
|
@DisplayName("builtins are loaded")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testKotlinJsBuiltins(gradleVersion: GradleVersion) {
|
fun testKotlinJsBuiltins(gradleVersion: GradleVersion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user