You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that detection of whether something is a DOM Node is very optimistic. I'm faced with a problem when trying to console.log a Backbone.View ( or any view that inherits form a Backbone.View ) because every Backbone.View has 'tagName' attribute, and this causes the following error in Karma because it expects a DOM node, but gets a Backbone.View in stead.
PhantomJS 2.1.1 (Linux 0.0.0) ERROR TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)') at http://localhost:9877/karma.js:1363
var V = new Backbone.View(); console.log( V ) // Will output the View object in the console
Actual behavior
var V = new Backbone.View(); console.log( V )
`PhantomJS 2.1.1 (Linux 0.0.0) ERROR
TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)')
at http://localhost:9877/karma.js:1363``
Enviroment Details
Karma version (output of karma --version): Karma version: 0.13.22
Relevant part of your karma.config.js file: Nothing specific
Steps to reproduce the behaviour
Instantiate a Backbone.View ( Or use any object that has 'tagName' attribute' )
console.log the instance
The text was updated successfully, but these errors were encountered:
Karma overwrites native console.log and tries to stringify every attribute it gets passed into it so it can create an output. In the process if it encounters a DOM node or a DOM Element it attempts to serialize it https://github.com/karma-runner/karma/blob/master/client/stringify.js#L41
The problem is that detection of whether something is a DOM Node is very optimistic. I'm faced with a problem when trying to console.log a Backbone.View ( or any view that inherits form a Backbone.View ) because every Backbone.View has 'tagName' attribute, and this causes the following error in Karma because it expects a DOM node, but gets a Backbone.View in stead.
PhantomJS 2.1.1 (Linux 0.0.0) ERROR TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)') at http://localhost:9877/karma.js:1363
Possible solution is to change the way of checking if something is a DOM Node / Element http://stackoverflow.com/a/4754156/3193466
Expected behavior
var V = new Backbone.View(); console.log( V )
// Will output the View object in the console
Actual behavior
var V = new Backbone.View(); console.log( V )
`PhantomJS 2.1.1 (Linux 0.0.0) ERROR
TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)')
at http://localhost:9877/karma.js:1363``
Enviroment Details
karma --version
): Karma version: 0.13.22karma.config.js
file: Nothing specificSteps to reproduce the behaviour
The text was updated successfully, but these errors were encountered: