karma-jasmine
karma-jasmine copied to clipboard
Opening DEBUG window fires an error for parentWindow.karma object "Cannot read property 'error' of undefined"
Everytime I click on "DEBUG" mode to open a new window with the Jasmine results, no matter what the real error is I end up with
TypeError: Cannot read property 'error' of undefined
That fires on the following line in context.js
if (!parentWindow.karma[method]) {
parentWindow.karma.error('Expected Karma method "' + method + '" to exist but it doesn\'t')
return
}
It's the 'karma' property that's undefined. Looking at the original window, it has it, so for whatever reason either parentWindow isn't that window or the karma property isn't visible to the new window.
window.parent === window in this case.
"If a window does not have a parent, its parent property is a reference to itself."
@ayyash could you provide gist which reproduces the problem
Thanks
Sorry that was a long time ago, I haven't done work on karma since then
Riding a dead horse but perhaps this is helping someone:
I had this error with an pending('waiting for adjustment')
inside an describe
.
Moving inside it
solved the problem here.