[Kotlin] Remove Kotlin SDK in the tear down of light fixture tests

Light descriptors for Kotlin JS projects now set up module's platform correctly.
This triggers Kotlin startup activity to create a Kotlin SDK.
This SDK should be removed after the tests to prevent leaks.

KT-65892

GitOrigin-RevId: 7fae6062ac1bc10f62f27bf9acb8dc43038e6eb8
This commit is contained in:
Pavel Kirpichenkov
2024-03-27 18:04:21 +00:00
committed by intellij-monorepo-bot
parent 8e872e6f08
commit a8bf8a4094
@@ -57,6 +57,7 @@ import org.jetbrains.kotlin.idea.facet.getOrCreateFacet
import org.jetbrains.kotlin.idea.facet.removeKotlinFacet
import org.jetbrains.kotlin.idea.formatter.KotlinLanguageCodeStyleSettingsProvider
import org.jetbrains.kotlin.idea.formatter.KotlinOfficialStyleGuide
import org.jetbrains.kotlin.idea.framework.KotlinSdkType
import org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
import org.jetbrains.kotlin.idea.serialization.updateCompilerArguments
import org.jetbrains.kotlin.idea.test.CompilerTestDirectives.API_VERSION_DIRECTIVE
@@ -174,6 +175,7 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
override fun tearDown() {
runAll(
{ mockLibraryFacility?.tearDown(module) },
{ KotlinSdkType.removeKotlinSdkInTests() },
{ runCatching { project }.getOrNull()?.let { disableKotlinOfficialCodeStyle(it) } },
{ super.tearDown() },
)