linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

console.dir() in spec testing #332

Closed peterbe closed 9 years ago

peterbe commented 9 years ago

I tried this:

it(..., function () {
  console.log({some: 'thing'})
})

and I'm running testem (which is awesome) but it prints nothing :( Isn't this node?

I couldn't wait so I add this to spec/helper.js:

console.dbg = function() {
  for (var i = 0; i < arguments.length; i++) {
    var argument = arguments[i];
    if (typeof argument === 'object') {
      console.log(JSON.stringify(argument, undefined, 2));
    } else {
      console.log(argument);
    }
  }
};

Now it prints nicely. screenshot 2014-11-07 15 27 27

peterbe commented 9 years ago

But hang on, is it node or not?

I also found that if I open the browser window (that I normally hide and don't look at) it supports the console.dir. screenshot 2014-11-07 15 28 15

peterbe commented 9 years ago

But I don't want to use that window. I prefer the black testem window.

searls commented 9 years ago

You should consider opening an issue on testem

On Fri, Nov 7, 2014 at 6:29 PM, Peter Bengtsson notifications@github.com wrote:

But hang on, is it node or not? I also found that if I open the browser window (that I normally hide and don't look at) it supports the console.dir.

screenshot 2014-11-07 15 28 15

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/332#issuecomment-62230923

peterbe commented 9 years ago

Thanks @searls https://github.com/airportyh/testem/issues/426