-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves the tests from ScalaJsToolchainSpec into frontend
- Loading branch information
1 parent
901f536
commit 7985bda
Showing
3 changed files
with
71 additions
and
96 deletions.
There are no files selected for viewing
87 changes: 0 additions & 87 deletions
87
bridges/scalajs-1-test/src/test/scala/bloop/scalajs/ScalaJsToolchainSpec.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package bloop | ||
|
||
import java.util.concurrent.TimeUnit | ||
|
||
import scala.concurrent.duration.Duration | ||
import bloop.util.TestUtil | ||
import bloop.logging.RecordingLogger | ||
import bloop.cli.Commands | ||
|
||
import bloop.testing.BaseSuite | ||
import bloop.cli.OptimizerConfig | ||
import bloop.engine.Run | ||
|
||
object LinkSpec extends BaseSuite { | ||
|
||
val MainJSProject = "test-projectJS" | ||
val TestJSProject = "test-projectJS-test" | ||
private final val maxDuration = Duration.apply(60, TimeUnit.SECONDS) | ||
|
||
val jsState0 = | ||
TestUtil.loadTestProject(TestUtil.getBloopConfigDir("cross-test-build-scalajs-1.x")) | ||
|
||
test("can link scalajs1.x project") { | ||
|
||
val logger = new RecordingLogger | ||
val action = Run(Commands.Link(List(MainJSProject))) | ||
val resultingState = | ||
TestUtil.blockingExecute(action, jsState0.copy(logger = logger), maxDuration) | ||
|
||
assert( | ||
resultingState.status.isOk | ||
) | ||
assert( | ||
logger | ||
.getMessagesAt(level = Some("info")) | ||
.find(_.contains("Generated JavaScript file")) | ||
.isDefined | ||
) | ||
} | ||
|
||
test("can link scalajs-1.x project in release mode") { | ||
val logger = new RecordingLogger | ||
val mode = OptimizerConfig.Release | ||
val state = jsState0.copy(logger = logger) | ||
val action = Run(Commands.Link(List(MainJSProject), optimize = Some(mode))) | ||
val resultingState = TestUtil.blockingExecute(action, state, maxDuration * 2) | ||
|
||
assert(resultingState.status.isOk) | ||
assert( | ||
logger | ||
.getMessagesAt(level = Some("debug")) | ||
.find(_.contains("Optimizer: Batch mode: true")) | ||
.isDefined | ||
) | ||
} | ||
|
||
test("can run scalaJS project") { | ||
val logger = new RecordingLogger | ||
val state = jsState0.copy(logger = logger) | ||
val action = Run(Commands.Run(List(MainJSProject))) | ||
val resultingState = TestUtil.blockingExecute(action, state, maxDuration) | ||
|
||
assert(resultingState.status.isOk) | ||
assert( | ||
logger | ||
.getMessagesAt(level = Some("info")) | ||
.find(_.contains("Hello, world!")) | ||
.isDefined | ||
) | ||
} | ||
} |