Skip to content

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

Closed
karma-runner/karma-ie-launcher
#13

Description

@sylvain-hamel

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?

Activity

  1. vojtajina commented on Mar 8, 2014

    @vojtajina
    Contributor

    Duplicate #631

  2. added 2 commits that reference this issue on Mar 13, 2014
    febbf82
    d75a111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions