Skip to content

Run karma on IE using multiple emulation modes by setting http-equiv="X-UA-Compatible" #936

Closed
sylvain-hamel opened this Issue Mar 4, 2014 · 1 comment

2 participants

@sylvain-hamel
Karma member

I'd like to run my tests on multiple IE "modes": IE10, IE9, EI8

I figured I can edit those 2 files:

karma\static\debug.html
karma\static\client.html

and add the right header
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

and it works.

Now I'd like to create multiple browser configurations, presumably using customLaunchers to handle that:

customLaunchers: {
  ie_9: {
    base: 'IE',
    mode: 'IE=EmulateIE9'
  },
  ie_8: {
    base: 'IE',
    mode: 'IE=EmulateIE8'
  }
}

Is this already supported?

If it's not supported, I'm willing to work on this feature and submit a PR but I need some guidance as to how to approach this.

I've read the source code for the middleware/karma.js and I saw that it modifies debug.html and client.html on-the-fly. I guess I could add the <meta> tag using a custom middleware.

  • Does karma support plug-ins in the form of custom middleware? How would I register it?
  • Will the middleware have access to the "current" launcher configuration to read the mode and add the right <meta> tag?

If a plug-in is not possible, what approach would you recommend? Would it be acceptable to change middleware/karma.js to add the <meta> tag based the karma configuration?

@vojtajina

Duplicate #631

@vojtajina vojtajina closed this Mar 8, 2014
@sylvain-hamel sylvain-hamel added a commit to sylvain-hamel/karma that referenced this issue Mar 13, 2014
@sylvain-hamel sylvain-hamel feat(web-server): run karma using multiple emulation modes
Closes #936, #631
febbf82
@sylvain-hamel sylvain-hamel added a commit to sylvain-hamel/karma that referenced this issue Mar 31, 2014
@sylvain-hamel sylvain-hamel feat(web-server): run karma using multiple emulation modes
Closes #936, #631
b9a2930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.