-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error getting failed test output in IE11 without iframe #2061
Error getting failed test output in IE11 without iframe #2061
Comments
Any progress on this? |
Can you provide more details here? |
@AStoker I've created a minimal setup for reproducing the bug: https://github.com/kostia/karma-runner-karma-issues-2061. Since I'm on OSX, I use Saucelabs for running IE tests. It should however result in the same error in an IE running in a VM. Please let me if you need more info or support on how to use this setup with an IE in a VM. |
I'm not a Karma master here, but trying to help you out where I can :) |
Thanks! 😄
The test works when it's running in Safari, Firefox (Linux) and Chrome (Linux). The issues occurs only in IE. |
Could this then be an issue more related to Saucelabs and how it compiles tests for IE? |
Unfortunately this problem also appears when the tests are running in the IE running in a VM with no Saucelabs involved. As mentioned, I can create a minimal setup able to reproduce the issue in an IE running in the VirtualBox. Here the setup:
NB: If you wish to reproduce the issue on Saucelabs, you now should run |
Leaning more towards perhaps some issue with Jasmine and it's setup now... Can you put a |
The output looks like this: |
That does seem to be what could be the issue. Can you do the same thing but run the test in something that works, and then compare the object to what you just posted? |
In Chrome (OSX) it is |
So now here's when the debugging comes in. Can you maybe put a console.trace() right there and then follow the call stack up to find out where that object is turned into an array? |
Sorry, I don't get it 😞 |
Maybe. That was the call stack at the time the error was caught. Sometimes caught errors don't always output all the details of the call stack. But in this case, it's quite possible it's the same. In which case, you can go up that call stack you already have and try and find the location where it's trying to convert the object to an array. |
It would be great if somebody else from the Karma team knew exactly what's going on :P I'm just doing my best to try and guide to a solution. |
I could track the problem as far as to https://github.com/karma-runner/karma/blob/master/lib/events.js#L11. In this line |
I don't believe that |
Right, it's not typical in an arbitrary object. But an array-like object should have that one, see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Array-like_objects. Since I'm not a Karma expert, I don't know who's building that arrays and how. Unfortunately due to a distributed nature of Karma, it is not obvious, who's actually sending that object 😞 |
Also I'm wondering, why the hack the issue only appears when running Karma with |
Yes, an array-like object should have one, but something still makes that array like object, and it would help to identify where that is taking place. So when running in IE, it works with the useIframe being true, but not false? |
That's what I'm trying to identify the last 5 hours…
Yes. But unfortunately it's not an option for us. |
Those are two big bummers... |
You would need to register on Saucelabs, I guess… So just skip it. Running in a VM has the same effect. |
Here what I found out so far:
|
Here my monkey patch, which converts array like objects to arrays: // karma/static/karma.js
this.result = function (result) {
if (!startEmitted) {
socket.emit('start', {total: null})
startEmitted = true
}
if (resultsBufferLimit === 1) {
// Here comes the fix…
var fixedResult = {}
for (var propertyName in result) {
if (result.hasOwnProperty(propertyName)) {
var propertyValue = result[propertyName];
if (Object.prototype.toString.call(propertyValue) === '[object Array]') {
fixedResult[propertyName] = Array.prototype.slice.call(propertyValue);
} else {
fixedResult[propertyName] = propertyValue;
}
}
}
return socket.emit('result', fixedResult)
}
resultsBuffer.push(result)
if (resultsBuffer.length === resultsBufferLimit) {
socket.emit('result', resultsBuffer)
resultsBuffer = []
}
} |
Expected behavior
Output of a failed test in IE11 gets logged in the console.
Actual behavior
An error is raised:
Enviroment Details
conf.js
Steps to reproduce the behaviour
Simply run a failing spec:
The crucial part it the switch
client.useIframe
. The error is only raise if the iframe is disabled as in my config.The text was updated successfully, but these errors were encountered: