-
Notifications
You must be signed in to change notification settings - Fork 127
Fixed #183: JSDOMNodeJSEnv is handled incorrectly (Scalajs support) #212
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
Conversation
Hi @gslowikowski, could you, please, take a look to this PR when you will have some time? Since there is a strong demand to make scoverage work for UI testing in scala-js using Node.js/jsdom env, it would be really great if we could make it work at least from scoverage side. Thanks! |
Any updates on this? |
Hi I've created simple project with jsdom env https://github.com/gslowikowski/scoverage-scalajs-node-jsdom-example, but JS module tests fail when building with the version of scoverage plugin from this pull request. Maybe I'm doing something wrong. @viktor-podzigun can you help me to verify your PR? |
Hi @gslowikowski, I've made PR to your test project with some changes, please, see my comments in I think we would need to make one more PR to make it work with JSDOMNodeJSEnv, as the one I've made for scalajs-bundler |
425a691
to
04e46a3
Compare
@viktor-podzigun I know this has been stale for quite some time, but is this still relevant? If so, are you able to rebase? |
@ckipp01 ok, re-based it one more time on the latest |
gslowikowski/scoverage-scalajs-node-jsdom-example#1 (comment) From this comment though, which has already been a couple years ago, it seems that this is sort of no longer a thing? |
@ckipp01 maybe Phantom is no longer a thing, but that's exactly why we should make it work with node.js in the first place :) and that is this change proposed here is all about. The thing is, that when we install jsdom in node.js env. it is detected as Phantom atm. |
ahhhh, totally misunderstood that. Thanks for clarifying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pr @viktor-podzigun and sorry it's stood still for so long. LGTM
Fixes #183
UPDATED! Original PR description:
In this PR made attempt to correctly identify Node.js environments (with or without jsdom).
In order to detect Node.js environment I'm using the
global
object (approach, suggested here):It doesn't break existing logic and it is a step forward to fixing #183.
There should be also a corresponding change applied for
JSDOMNodeJSEnv
class in scala-js/scalajs-bundler to exportglobal
object, either by extending it with a setting to do so, or by creating separate implementation (see discussion here).