Skip to content

JSDOMNodeJSEnv is handled incorrectly (Scalajs support issue) #183

Closed
@vpavkin

Description

@vpavkin

When jsEnv is set to JSDOMNodeJSEnv().value, plugin treats it as PhantomJS environment.

This environment has a window property, so this conditional treats it as PhantomJS:
https://github.com/lustefaniak/scalac-scoverage-plugin/blob/master/scalac-scoverage-runtime/js/src/main/scala/scalajssupport/File.scala#L62

As a consequence - tests fail with:

scala.scalajs.js.JavaScriptException: TypeError: $g.callPhantom is not a function

The conditional should be tweaked somehow (no suggestions yet, so far just reporting).


Steps to reproduce:

  1. Add to build.sbt jsEnv in Test := JSDOMNodeJSEnv().value
  2. npm install jsdom
  3. run tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions