Skip to content

Commit cf6a59b

Browse files
committed
Backport exception tests from SeleniumJSEnv
1 parent 3a03cce commit cf6a59b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ private[test] class RunTests(config: JSEnvSuiteConfig, withCom: Boolean) {
2828
""".fails()
2929
}
3030

31+
@Test
32+
def throwExceptionTest: Unit = {
33+
"""
34+
throw 1;
35+
""".fails()
36+
}
37+
38+
@Test
39+
def catchExceptionTest: Unit = {
40+
"""
41+
try {
42+
throw "hello world";
43+
} catch (e) {
44+
console.log(e);
45+
}
46+
""" hasOutput "hello world\n"
47+
}
48+
3149
@Test // Failed in Phantom - #2053
3250
def utf8Test: Unit = {
3351
"""

0 commit comments

Comments
 (0)