Skip to content
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

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 · Fixed by karma-runner/karma-ie-launcher#13 or #951

Comments

@sylvain-hamel
Copy link
Contributor

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
Copy link
Contributor

Duplicate #631

sylvain-hamel added a commit to sylvain-hamel/karma-ie-launcher that referenced this issue Mar 13, 2014
sylvain-hamel added a commit to sylvain-hamel/karma-ie-launcher that referenced this issue Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants