Skip to content

Setup test project #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
Test project for https://github.com/scoverage/scalac-scoverage-plugin/issues/183

Run `npm install jsdom` before building.

Run all the tests and see the coverage:
```bash
sbt clean coverage test coverageReport && sbt coverageAggregate
```
22 changes: 20 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ lazy val cross = CrossProject("test", file("."))(JVMPlatform, JSPlatform)
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.3",
scalaJSStage := FastOptStage,
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv()

// uncomment to test with corresponding env
// it works out of the box for these envs
//
//jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv()
//jsEnv := new org.scalajs.jsenv.rhino.RhinoJSEnv(withDOM = true)

// not tested !!!
//
//jsEnv := new org.scalajs.jsenv.phantomjs.PhantomJSEnv()

//!!! requires patching !!! for exposing `global` object
// see for example: https://github.com/scalacenter/scalajs-bundler/pull/198/files
//
//jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv()

// works with scalajs-bundler with PR: https://github.com/scalacenter/scalajs-bundler/pull/198
//
requireJsDomEnv in Test := true
)

lazy val crossJS = cross.js
lazy val crossJS = cross.js.enablePlugins(ScalaJSBundlerPlugin)
lazy val crossJVM = cross.jvm
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version = 1.2.8
6 changes: 6 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

//use patched versions by now, to make scoverage work with scalajs-bundler
addSbtPlugin(("org.scommons.patched" % "sbt-scalajs-bundler" % "0.14.0-SNAPSHOT").force())

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0")
Expand Down