[Gradle, JS] Ignore stdout for mocha dry run
^KT-61992 fixed
This commit is contained in:
committed by
Space Team
parent
a68a2409d3
commit
5df8ac4d1a
+11
@@ -1298,6 +1298,17 @@ class Kotlin2JsIrGradlePluginIT : KGPBaseTest() {
|
|||||||
)
|
)
|
||||||
buildAndFail("nodeTest") {
|
buildAndFail("nodeTest") {
|
||||||
assertTasksFailed(":nodeTest")
|
assertTasksFailed(":nodeTest")
|
||||||
|
assertOutputContains("Cannot find module 'foo'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("mocha has no output during dry run")
|
||||||
|
@GradleTest
|
||||||
|
fun testMochaHasNoDryRunOutput(gradleVersion: GradleVersion) {
|
||||||
|
project("kotlin-js-nodejs-project", gradleVersion) {
|
||||||
|
build("nodeTest") {
|
||||||
|
assertOutputDoesNotContain("0 passing")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -59,6 +59,12 @@ class TCServiceMessagesTestExecutor(
|
|||||||
if (spec.dryRunArgs != null) {
|
if (spec.dryRunArgs != null) {
|
||||||
val exec = execHandleFactory.newExec()
|
val exec = execHandleFactory.newExec()
|
||||||
spec.forkOptions.copyTo(exec)
|
spec.forkOptions.copyTo(exec)
|
||||||
|
// get rid of redundant output during dry-run
|
||||||
|
exec.standardOutput = object : OutputStream() {
|
||||||
|
override fun write(b: Int) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
exec.args = spec.dryRunArgs
|
exec.args = spec.dryRunArgs
|
||||||
execHandle = exec.build()
|
execHandle = exec.build()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user