Skip to content

Commit e057dfc

Browse files
committed
Replace FrameworkDetector test with JSEnv test
This test was originally designed to make sure FrameworkDetector doesn't fail with other `console.log` statements. However, since 22a8d7dc52669c537154f21519752a8b6680a174 FrameworkDetector does not exist anymore. We replace the specific test with a more generalized test that ensures that stdout and the scalajsCom do not interact for JSEnvs in general.
1 parent e65a1d2 commit e057dfc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

js-envs-test-kit/src/main/scala/org/scalajs/jsenv/test/ComTests.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,26 @@ private[test] class ComTests(config: JSEnvSuiteConfig) {
108108
.closeRun()
109109
}
110110
}
111+
112+
@Test
113+
def separateComStdoutTest: Unit = {
114+
// Make sure that com and stdout do not interfere with each other.
115+
kit.withComRun("""
116+
scalajsCom.init(function (msg) {
117+
console.log("got: " + msg)
118+
});
119+
console.log("a");
120+
scalajsCom.send("b");
121+
scalajsCom.send("c");
122+
console.log("d");
123+
""") {
124+
_.expectOut("a\n")
125+
.expectMsg("b")
126+
.expectMsg("c")
127+
.expectOut("d\n")
128+
.send("foo")
129+
.expectOut("got: foo\n")
130+
.closeRun()
131+
}
132+
}
111133
}

0 commit comments

Comments
 (0)