Closed shellscape closed 9 years ago
I agree, as illustrated by $ curl 2> ~/error.log
dumping stderr to that file. Would you like to whip up a PR?
@metaskills let me see if I can do that, and not manage to screw it up. I'm coffeescript illiterate :)
Fair, but it is not that hard. Anyone that knows JS should be able to read this file and see where your points are. Can you please make an effort?
https://github.com/metaskills/mocha-phantomjs/blob/master/lib/mocha-phantomjs.coffee#L31
FYI, we have tests too. So you are not without a safety net.
This should just work but doesn't due to ariya/phantomjs#10150
There is a monkey patch solution suggested:
console.error = function () {
require("system").stderr.write(Array.prototype.join.call(arguments, ' ') + '\n');
};
which in coffee-script that is
console.error = ->
require("system").stderr.write(Array.prototype.join.call(arguments, ' ') + '\n')
or
console.error = ->
require('system').stderr.write "#{Array.prototype.join.call(arguments, ' ')}\n"
@nathanboktae wouldn't that work because core_extensions.js sets that up?
no this monkey patching needs to be done the PhantomJS side, not the browser side.
@nathanboktae @metaskills ping. made a commit last week on this one.
let's continue this discussion in the PR (in the future, you can attach pull requests to existing issues with the GitHub API)
Currently the
fail
method uses console.log. This is technically "incorrect." Since its explicitly in a failure state at that point, it should probably output to stderr or console.error.