-
Notifications
You must be signed in to change notification settings - Fork 101
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
Provide Node.js interface through global
object in JSDOMNodeJSEnv
#197
Comments
…t in JSDOMNodeJSEnv
Maybe what you need is a dedicated, custom |
From a point of view of scoverage plugin (or any other sbt-plugin that needs node system modules access) the interface should be the same. Since |
Or maybe better adding a configuration parameter for existing |
You can define your own |
…t in JSDOMNodeJSEnv
Has this been fixed / is there a workaround to make scoverage work? |
Hi @sjrd, |
If you ask me, I believe sbt settings are already proliferating too fast in this plugin. I wouldn't recommend adding any other setting unless absolutely necessary. In this instance, at the very least it can be a configuration option of the |
Thank you @sjrd for your quick feedback. Will try to prepare PR for And how can we apply it for Maybe we can merge these settings into single one, like: nodejsEnvConfig := NodejsEnvConfig(
requireJsDom = true,
exposeGlobal = true,
...
) Does it make sense? BTW, |
TBH I think that is a larger problem, that should be fixed first. It should be possible to just configure |
FYI, it's possible to use JSDOM with scoverage without this change. See scoverage/scalac-scoverage-plugin#456. |
Currently, in
JSDOMNodeJSEnv
(which is the case whenrequiresDOM in Test := true
) there is no Node.jsglobal
object exposed.Though, in plain
NodeJSEnv
it is available and can be used as a way to detect/use Node.js environment described here.As a result there is no way for test frameworks/plugins (like
scoverage
, for example) to access/use Node internal/system modules (require("fs")
andrequire("path")
, for example).Motivation:
Fixing this issue would be a step forward to make
scoverage
work withscalajs-bundler
together with corresponding fix for this issue in the scoverage-pluginThe text was updated successfully, but these errors were encountered: