Wizard: do not add test task for JS when no test framework is chosen

#KT-40378 fixed
This commit is contained in:
Ilya Kirillov
2020-07-16 20:18:02 +03:00
parent 0208fad057
commit 9f5dd59d75
@@ -43,7 +43,11 @@ interface JSConfigurator : ModuleConfiguratorWithModuleType, ModuleConfiguratorW
if (reader.isApplication(module)) {
applicationCssSupport()
}
testCssSupport()
}
if (this@JSConfigurator is ModuleConfiguratorWithTests
&& reader.settingValue(module, ModuleConfiguratorWithTests.testFramework) != KotlinTestFramework.NONE
) {
testTask(cssSupport = reader.hasCssSupport(module))
}
}
}
@@ -132,11 +136,13 @@ fun GradleIRListBuilder.applicationCssSupport() {
}
}
fun GradleIRListBuilder.testCssSupport() {
fun GradleIRListBuilder.testTask(cssSupport: Boolean) {
"testTask" {
"useKarma" {
+"useChromeHeadless()"
+"webpackConfig.cssSupport.enabled = true"
if (cssSupport) {
+"webpackConfig.cssSupport.enabled = true"
}
}
}
}