question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error getting failed test output in IE11 without iframe

See original GitHub issue

Expected behavior

Output of a failed test in IE11 gets logged in the console.

Actual behavior

An error is raised:

TypeError: result.suite.join is not a function
    at specFailure (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/reporters/base.js:94:33)
    at onSpecComplete (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/reporters/base.js:80:12)
    at null.<anonymous> (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/events.js:13:22)
    at emitTwo (events.js:100:13)
    at emit (events.js:185:7)
    at onResult (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/browser.js:216:13)
    at Array.forEach (native)
    at onResult (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/browser.js:206:21)
    at Socket.<anonymous> (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/karma/lib/events.js:13:22)
    at emitOne (events.js:95:20)
    at Socket.emit (events.js:182:7)
    at Socket.onevent (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/socket.io/lib/socket.js:335:8)
    at Socket.onpacket (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/socket.io/lib/socket.js:295:12)
    at Client.ondecoded (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/socket.io/lib/client.js:193:14)
    at Decoder.Emitter.emit (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/component-emitter/index.js:134:20)
    at Decoder.add (/Users/kostia/Code/tmp/karma-ie-debug/node_modules/socket.io-parser/index.js:247:12)

Enviroment Details

  • “jasmine”: “2.4.1”,
  • “karma”: “0.13.22”
  • “karma-jasmine”: “0.3.6”
  • “karma-sauce-launcher”: “0.3.0”
  • conf.js
module.exports = function(config) {
  config.set({
    singleRun: true,
    frameworks: ['jasmine'],
    files: ['test_spec.js'],
    client: {
      useIframe: false
    },
    browsers: ['ie'],
    customLaunchers: {
      ie: {
        base: 'SauceLabs',
        os: 'Windows 7',
        browserName: 'internet explorer',
        version: '11'
      }
    },
    sauceLabs: {
      startConnect: false,
      tunnelIdentifier: process.env.SAUCELABS_TUNNEL_IDENTIFIER,
      testName: 'debug',
    },
  });
};

Steps to reproduce the behaviour

Simply run a failing spec:

// test_spec.js
describe('when running failing specs on IE11', function() {
  it('raises an error while capturing test output', function() {
    expect(true).toBe(false);
  });
});

The crucial part it the switch client.useIframe. The error is only raise if the iframe is disabled as in my config.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
AStokercommented, Jun 2, 2016

It would be great if somebody else from the Karma team knew exactly what’s going on 😛 I’m just doing my best to try and guide to a solution.

0reactions
kostiacommented, Jun 3, 2016

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 = []
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix web compatibility issues using document modes and the ...
Test your sites for document mode compatibility · Go to a site having compatibility problems, press F12 to open the F12 Developer Tools,...
Read more >
Images failing to load in IE with DOM: 7009 error (unable to ...
I'ts not an imgur problem, its an IE11 problem. The only way that I have been able to get out of the issue...
Read more >
The Official Discussion Forum of Katalon - Katalon Community
IE 11 with Katalon 7.2.1 - gives console errors and fails to run test ... I try to drag an element our side...
Read more >
Debug JavaScript in Internet Explorer 11 in 7 easy steps
Need to debug JavaScript in Internet Explorer? Simply follow these 7 steps. Includes examples. Read our debugging guide today.
Read more >
Embedded Report not working in IE 11, but works on Chrome
We need a change to be made on the PowerBI side which will allow our IE11 to start presenting the Iframe without error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found