-
Notifications
You must be signed in to change notification settings - Fork 3
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
Set console.error to console.log if unset #48
base: main
Are you sure you want to change the base?
Conversation
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.
Would it be possible to have a test for this in https://github.com/scala-js/scala-js-env-phantomjs/blob/master/phantomjs-env/src/test/scala/org/scalajs/jsenv/phantomjs/PhantomJSEnvTest.scala ? If not, why not?
Could you also include the issue number in the commit message:
Fix #47: Set console.error to console.log if unset
phantomjs-env/src/main/scala/org/scalajs/jsenv/phantomjs/PhantomJSEnv.scala
Show resolved
Hide resolved
I do not understand. The fix seems inconsistent with what is mentioned in scala-js/scala-js#1555 / ariya/phantomjs#13112. It says that PhantomJS crashes when But the fix seems to set It seems that this is a PhantomJS2 issue. So to properly test it, we'd have to start testing with PhantomJS2. Feels like we have the following options:
|
Apparently the CI is already running with PhantomJS 2.1.1: https://travis-ci.org/github/scala-js/scala-js-env-phantomjs/jobs/696416719#L119, which raises the question: why is it already working on master with PhantomJS 2, but not in the context of @japgolly's repos? :-s |
@sjrd Yes! But only a test that
@gzm0 Personally I don't care how we get there as long as I will just say I don't like this potential outcome. I wouldn't be surprised if I'm the guy that sends the most volume through scala-js-env-phantomjs, which is why I'm the only to come across this. But it is a genuine and general bug. If anyone else starts using scala-js-env-phantomjs heavily they'll likely come across this too. |
Guys any advice on testing this? Went with the following and it passes without the fix: kit.start("console.error('test')").expectOut("test").closeRun() |
Well, if it fails without the fix, then its a good test :) Otherwise, it doesn't test what you fixed :) |
@japgolly What's the smallest reproduction of the issue that you managed to get so far? From there we might be able to suggest a minimal test case. |
TBH I don't understand why you're still using PhantomJS at all. It's been officially dead for years. The only reason we published scalajs-env-phantomjs for Scala.js 1.x is not to break existing workflows, but we've been recommending Node.js with jsdom for years. Compare the download numbers for the jsdom environment: with those of scalajs-env-phantomjs: That's a 30x difference. |
@gzm0 Think you misread me there. It passes without the fix. I wish it failed without the fix :D Bizarre.
None because it's too intertwined with all of my private code. :(
Oh I know but two reasons:
|
Fixes #47