Skip to content
This repository has been archived by the owner on May 27, 2018. It is now read-only.

Array.prototype.indexOf not supported on IE8 #8

Closed
foxbunny opened this issue Feb 3, 2014 · 0 comments
Closed

Array.prototype.indexOf not supported on IE8 #8

foxbunny opened this issue Feb 3, 2014 · 0 comments

Comments

@foxbunny
Copy link

foxbunny commented Feb 3, 2014

I'm currently running some tests on IE8, and toHaveClass matcher fails on IE8 because Array.prototype.indexOf is undefined.

To work around this issue, I've patched the matcher to use regex:

    toHaveClass: function(className)
    {
      var classes = jasmine.DOM.trim(this.actual.className);
      return RegExp('(^| )' + className + '( |$)').test(classes);
    },

The regex itself comes from here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant