Skip to content

Commit c1e3714

Browse files
committed
Factor basic JSEnv tests in trait
1 parent 0c85ccd commit c1e3714

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

js-envs/src/test/scala/org/scalajs/jsenv/test/AsyncTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import scala.concurrent.Await
1313
import scala.concurrent.duration._
1414

1515
/** A couple of tests that test async runners for mix-in into a test suite */
16-
trait AsyncTests {
16+
trait AsyncTests extends BasicJSEnvTests {
1717

1818
protected final val DefaultTimeout: Duration = 10.seconds
1919

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.scalajs.jsenv.test
2+
3+
import org.junit.Test
4+
import org.junit.Assert._
5+
6+
/** Tests that should succeed on any JSEnv */
7+
trait BasicJSEnvTests extends JSEnvTest {
8+
9+
@Test
10+
def failureTest: Unit = {
11+
12+
"""
13+
var a = {};
14+
a.foo();
15+
""".fails()
16+
17+
}
18+
19+
@Test
20+
def syntaxErrorTest: Unit = {
21+
22+
"""
23+
{
24+
""".fails()
25+
26+
}
27+
28+
}

0 commit comments

Comments
 (0)