8000 Merge pull request #3700 from gzm0/test-common-js-test · sueka/scala-js@2e2e2bc · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e2e2bc

Browse files
authored
Merge pull request scala-js#3700 from gzm0/test-common-js-test
Also run test-common tests in JS
2 parents 6be482d + a9efb42 commit 2e2e2bc

File tree

9 files changed

+133
-181
lines changed

9 files changed

+133
-181
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def Tasks = [
146146
"test-suite-ecma-script2015": '''
147147
setJavaVersion $java
148148
npm install &&
149-
sbtretry ++$scala jUnitTestOutputsJVM/test jUnitTestOutputsJS/test \
150-
'set scalaJSStage in Global := FullOptStage' jUnitTestOutputsJS/test &&
149+
sbtretry ++$scala jUnitTestOutputsJVM/test jUnitTestOutputsJS/test testBridge/test \
150+
'set scalaJSStage in Global := FullOptStage' jUnitTestOutputsJS/test testBridge/test &&
151151
sbtretry ++$scala $testSuite/test &&
152152
sbtretry 'set scalaJSStage in Global := FullOptStage' \
153153
++$scala $testSuite/test \

junit-test/shared/src/test/scala/org/scalajs/junit/AsyncTest.scala

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,20 @@ import org.scalajs.junit.async._
2323

2424
class AsyncTest {
2525
@Test
26-
def success(): AsyncResult = {
27-
val res = Future(1 + 1).filter(_ == 2)
28-
await(res)
26+
def success(): AsyncResult = await {
27+
Future(1 + 1).filter(_ == 2)
2928
}
3029

3130
@Test(expected = classOf[IllegalArgumentException])
32-
def expectedException(): AsyncResult = {
31+
def expectedException(): AsyncResult = await {
3332
// Do not throw synchronously.
34-
val res = Future.failed(new IllegalArgumentException)
35-
await(res)
33+
Future.failed(new IllegalArgumentException)
3634
}
3735

3836
@Test
39-
def asyncFailure(): AsyncResult = {
37+
def asyncFailure(): AsyncResult = await {
4038
// Do not throw synchronously.
41-
val res = Future.failed(new IllegalArgumentException)
42-
await(res)
39+
Future.failed(new IllegalArgumentException)
4340
}
4441
}
4542

junit-test/shared/src/test/scala/org/scalajs/junit/utils/JUnitTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ abstract class JUnitTest {
5555
List('v', 's', 'n')
5656
)
5757

58-
@Test def testJUnitOutput(): AsyncResult = {
58+
@Test def testJUnitOutput(): AsyncResult = await {
5959
val futs = for (args <- frameworkArgss) yield {
6060
for {
6161
rawOut <- runTests(args.map("-" + _))
@@ -78,7 +78,7 @@ abstract class JUnitTest {
7878
}
7979
}
8080

81-
await(Future.sequence(futs).map(_ => ()))
81+
Future.sequence(futs).map(_ => ())
8282
}
8383

8484
private def runTests(args: List[String]): Future[List[Output]] = {

0 commit comments

Comments
 (0)
0