Skip to content

Functions logged as null #640

Closed
Closed
@futuraprime

Description

I've been significantly frustrated in debugging tests because Karma's logs report null whenever they see a function, e.g.

console.log("this is a function:", function() { return 'wat'; });

yields

Chrome 28.0 (Mac) LOG: [ 'this is a function:', null ]

whereas inside the debug view in Chrome, it correctly logs the function. Worse, where it's seeing null everywhere it quashes objects, so this mock:

var App = function() {
  return {
    pageController : {
      currentPage : {
        on : function() {},
        toJSON : function() {},
        get : function() {
          return dark;
        }
      }
    },
    mainLayout : {
      header : {
        show : function() {},
        $el : {}
      }
    }
  };
};

console.log("in test", App());

is logged out as:

Chrome 28.0 (Mac) LOG: [ 'in test',
  { pageController: {},
    mainLayout: { header: [Object] } } ]

where pageController is inaccurately shown as an empty object. (Again, in Chrome's debugger, the log correctly reflects what's going on.)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions