Skip to content

Commit

Permalink
Tests now only work with NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
japgolly committed Mar 14, 2017
1 parent 2483f31 commit 43dfac3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 39 deletions.
15 changes: 5 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ scala:
jdk:
- oraclejdk8

# Use PhantomJS 2
# https://mediocre.com/forum/topics/phantomjs-2-and-travis-ci-we-beat-our-heads-against-a-wall-so-you-dont-have-to
install:
- mkdir travis-phantomjs
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O "$PWD"/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
- tar -xvf "$PWD"/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C "$PWD"/travis-phantomjs
- export PATH="$PWD/travis-phantomjs:$PATH"

env:
global:
JSENV=phantom
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
- npm install
- npm install jsdom source-map-support

script:
- sbt ++$TRAVIS_SCALA_VERSION test:fastOptJS test:fullOptJS
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Thanks for considering contributing.

In order to get started, follow the instructions here:
https://gist.github.com/japgolly/775314a0cb24e33653b059b8f8540250


In order to preserve the quality and maintainability of this project
please ensure the following when submitting a PR:

Expand Down
2 changes: 1 addition & 1 deletion doc/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Setup
scalaJSStage in Test := FastOptStage
```

3. To [workaround](https://github.com/scala-js/scala-js/issues/1555) a [PhantomJS bug](https://github.com/ariya/phantomjs/issues/13112) that causes tests to crash if they write to stderr, copy [`PhantomJS2Env.scala`](../project/PhantomJS2Env.scala) to your `project` directory and add this to SBT:
3. To [workaround](https://github.com/scala-js/scala-js/issues/1555) a [PhantomJS bug](https://github.com/ariya/phantomjs/issues/13112) that causes tests to crash if they write to stderr, copy [`PhantomJS2Env.scala`](https://github.com/japgolly/scalajs-react/blob/v1.0.0-RC1/project/PhantomJS2Env.scala) to your `project` directory and add this to SBT:

```scala
jsEnv in Test := new PhantomJS2Env(scalaJSPhantomJSClassLoader.value)
Expand Down
9 changes: 1 addition & 8 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,8 @@ object ScalajsReact {
}))
)

val setupJsEnv: Project => Project =
sys.env.get("JSENV").map(_.toLowerCase.replaceFirst("js$", "")) match {
case Some("phantom") | None => _.settings(jsEnv in Test := new PhantomJS2Env(scalaJSPhantomJSClassLoader.value))
case Some("node") => identity
case Some(x) => sys error s"Unsupported JsEnv: $x"
}

def utestSettings: PE =
_.configure(useReactJs(Test), setupJsEnv, InBrowserTesting.js)
_.configure(useReactJs(Test), InBrowserTesting.js)
.settings(
scalacOptions in Test += "-language:reflectiveCalls",
libraryDependencies += "com.lihaoyi" %%% "utest" % Ver.MTest % "test",
Expand Down
20 changes: 0 additions & 20 deletions project/PhantomJS2Env.scala

This file was deleted.

0 comments on commit 43dfac3

Please sign in to comment.