From 3728dd45ce8256af5b0490c7e56eed292742b7ac Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Thu, 5 Mar 2020 18:07:59 +0300 Subject: [PATCH] [Gradle, JS] Remove redundant hacks for debug #KT-37037 fixed --- .../targets/js/testing/mocha/KotlinMocha.kt | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/testing/mocha/KotlinMocha.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/testing/mocha/KotlinMocha.kt index b43c5c1b1e5..d7434cddf1c 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/testing/mocha/KotlinMocha.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/testing/mocha/KotlinMocha.kt @@ -69,21 +69,13 @@ class KotlinMocha(override val compilation: KotlinJsCompilation) : .map { npmProject.require(it) } .single() - val adapter = createAdapterJs(file, debug) + val adapter = createAdapterJs(file) val args = mutableListOf( "--require", npmProject.require("source-map-support/register.js") ).apply { if (debug) { - // Idle run of tests to load file with source maps to enable break points - add("--require") - add( - npmProject.require("kotlin-test-js-runner/kotlin-test-nodejs-idle-runner.js") - ) - add("--require") - add(file) - add("--inspect-brk") } add(mocha) @@ -110,8 +102,7 @@ class KotlinMocha(override val compilation: KotlinJsCompilation) : } private fun createAdapterJs( - file: String, - debug: Boolean + file: String ): File { val npmProject = compilation.npmProject @@ -120,12 +111,6 @@ class KotlinMocha(override val compilation: KotlinJsCompilation) : val adapter = npmProject.require("kotlin-test-js-runner/kotlin-test-nodejs-runner.js") val escapedFile = file.jsQuoted() - if (debug) { - // Invalidate caches after idle run - writer.println("delete require.cache[require.resolve($escapedFile)]") - writer.println("delete require.cache[require.resolve('kotlin-test')]") - } - writer.println("require(${adapter.jsQuoted()})") writer.println("module.exports = require($escapedFile)")