File tree 4 files changed +40
-17
lines changed
tests-shared/src/main/scala/org/scalajs/dom/tests/shared
tests-webworker/src/main/scala/org/scalajs/dom/tests/webworker 4 files changed +40
-17
lines changed Original file line number Diff line number Diff line change 25
25
run : sbt -DCI=1 "++${{ matrix.scalaversion }}" test package doc
26
26
27
27
- name : Validate formatting
28
- run : sbt -DCI=1 "++${{ matrix.scalaversion }}" scalafmtCheck
28
+ run : sbt -DCI=1 "++${{ matrix.scalaversion }}" dom/ scalafmtCheck
29
29
30
30
- name : Validate api report
31
31
if : matrix.scalaversion != '2.11.12' && matrix.scalaversion != '3.0.1'
Original file line number Diff line number Diff line change @@ -4,20 +4,43 @@ addCommandAlias("prePR", "+prePR_nonCross")
4
4
5
5
val prePR_nonCross = taskKey[Unit ](" Performs all necessary work required before submitting a PR, for a single version of Scala." )
6
6
7
+ // Unfortunately we can't just call `root/Test/compile` because it doesn't take aggregation into account :(
7
8
ThisBuild / prePR_nonCross := Def .sequential(
8
- root / clean,
9
+
10
+ Def .task {
11
+ (root / clean).value
12
+ (scalafixRules / clean).value
13
+ (dom / clean).value
14
+ (testsShared / clean).value
15
+ (testsWebworker / clean).value
16
+ (testsChrome / clean).value
17
+ (testsFirefox / clean).value
18
+ (testsNodeJsdom / clean).value
19
+ (example / clean).value
20
+ },
21
+
9
22
dom / Compile / scalafmt,
10
23
Def .taskDyn {
11
24
if (scalaVersion.value.startsWith(" 2." ))
12
25
(dom / Compile / scalafix).toTask(" " )
13
26
else
14
27
Def .task[Unit ]((dom / Compile / compile).value)
15
28
},
16
- root / Test / compile,
29
+
30
+ Def .task {
31
+ (testsShared / Test / compile).value
32
+ (testsWebworker / Test / compile).value
33
+ (testsChrome / Test / compile).value
34
+ (testsFirefox / Test / compile).value
35
+ (testsNodeJsdom / Test / compile).value
36
+ (example / Test / compile).value
37
+ },
38
+
17
39
Def .taskDyn {
18
40
if (scalaVersion.value.startsWith(" 2.12." ))
19
41
Def .task[Unit ]((readme / Compile / compile).value)
20
42
else
21
43
Def .task(())
22
44
},
45
+
23
46
).value
Original file line number Diff line number Diff line change @@ -9,24 +9,24 @@ object AsyncTesting {
9
9
10
10
type AsyncResult = Future [Try [Unit ]]
11
11
12
- implicit final def global : ExecutionContext =
12
+ implicit def global : ExecutionContext =
13
13
ExecutionContext .global
14
14
15
15
def async (run : => Future [Any ]): AsyncResult = {
16
- val p = Promise [Try [Unit ]]()
17
- val timeout = setTimeout(1200 ) {
18
- p.tryComplete(Failure (new RuntimeException (" Test timed out." )))
19
- }
20
- setTimeout(1 ) {
21
- p.completeWith(run.transform { ta =>
22
- clearTimeout(timeout)
23
- Success (ta.map(_ => ()))
24
- })
25
- }
26
- p.future
16
+ val p = Promise [Try [Unit ]]()
17
+ val timeout = setTimeout(1200 ) {
18
+ p.tryComplete(Failure (new RuntimeException (" Test timed out." )))
19
+ }
20
+ setTimeout(1 ) {
21
+ p.completeWith(run.transform { ta =>
22
+ clearTimeout(timeout)
23
+ Success (ta.map(_ => ()))
24
+ })
25
+ }
26
+ p.future
27
27
}
28
28
29
- implicit class AsyncFutureOps [A ](private val self : Future [A ]) extends AnyVal {
29
+ implicit final class AsyncFutureOps [A ](private val self : Future [A ]) extends AnyVal {
30
30
def tap (f : A => Any ): Future [A ] =
31
31
self.map { a => f(a); a }
32
32
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import WebWorkerCmd._
29
29
trait WebWorkerTests {
30
30
import Client .{global => client }
31
31
32
- final def webWorkerTest (test : (WebWorkerCmd , String )) = async {
32
+ final protected def webWorkerTest (test : (WebWorkerCmd , String )) = async {
33
33
client.send(test._1).assertEquals(test._2)
34
34
}
35
35
You can’t perform that action at this time.
0 commit comments