busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

util.print deprecation warnings appearing in reporter output. Replace with console.log. #452

Closed GCheung55 closed 9 years ago

GCheung55 commented 9 years ago

node@0.12 is deprecating util.print: https://nodejs.org/api/util.html#util_util_print

Thoughts on replacing util.print with console.log?

dominykas commented 9 years ago

Seeing plenty of these myself... I'm not sure console.log is the way to go - my guess is that util.print was used, because console is hijacked during test runs to intercept the messages? So, probably a correct alternative might be to hook into process.stdout.

GCheung55 commented 9 years ago

I can swap with process.stdout. Do you think a fallback to console.log would be necessary in case process is undefined?

On May 12, 2015, at 1:33 PM, Dominykas Blyžė notifications@github.com wrote:

Seeing plenty of these myself... I'm not sure console.log is the way to go - my guess is that util.print was used, because console is hijacked during test runs to intercept the messages? So, probably a correct alternative might be to hook into process.stdout.

— Reply to this email directly or view it on GitHub.

dominykas commented 9 years ago

Can the process even be undefined? If there's util.print, I assume it's node code, therefore process should be also there. Either way, when I last looked at this, there was some other issue, but I can't recall... maybe sync/async problems... maybe something else. This needs a little bit of doc reading/research to list out what are the differences between the three things (util, console and stdout).

GCheung55 commented 9 years ago

Perhaps we can use util.log instead?

On May 13, 2015, at 2:16 AM, Dominykas Blyžė notifications@github.com wrote:

Can the process even be undefined? If there's util.print, I assume it's node code, therefore process should be also there. Either way, when I last looked at this, there was some other issue, but I can't recall... maybe sync/async problems... maybe something else. This needs a little bit of doc reading/research to list out what are the differences between the three things (util, console and stdout).

— Reply to this email directly or view it on GitHub.

dominykas commented 9 years ago

Docs say util.log will have a timestamp prepended... I'd say stdout approach is better, as you mentioned on IRC. I just really don't remember what was the problem with it :)

GCheung55 commented 9 years ago

I've switched to using process.stdout.

On May 14, 2015, at 12:44 AM, Dominykas Blyžė notifications@github.com wrote:

Docs say util.log will have a timestamp prepended... I'd say stdout approach is better, as you mentioned on IRC. I just really don't remember what was the problem with it :)

— Reply to this email directly or view it on GitHub.

GCheung55 commented 9 years ago

@augustl, @dwittner, @cjohansen: Thoughts on the change?

dominykas commented 9 years ago

I'm all for it - no commit rights, though :)

dwittner commented 9 years ago

@GCheung55 , version 0.7.13 of buster-test is released. Please check it.