Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Make unit tests run on IE8 #88

Closed
eastridge opened this issue Dec 27, 2012 · 13 comments
Closed

Make unit tests run on IE8 #88

eastridge opened this issue Dec 27, 2012 · 13 comments
Labels

Comments

@eastridge
Copy link
Contributor

Chai doesn't work with IE8, we need to upgrade to latest chai when it comes out or use another lib. Discussion here:

chaijs/chai#124

Note that for what it's worth the sample thorax apps run on IE8.

@GeorgeErickson
Copy link
Contributor

I plan to spend a few hours on this this weekend, and had a few questions.

  1. Where is the mocha dependency coming from, is it phoenix-build?
  2. Are you opposed to using expect.js over chai.expect?

@kpdecker
Copy link
Contributor

  1. Yep this should be the case.
  2. What are the differences between the two libraries? What would moving to expect.js provide?

A little bit of background, the phoenix-build project is utilized by most of our external and internal projects and I'd like to keep things somewhat uniform for the sanity of the team :)

@GeorgeErickson
Copy link
Contributor

It provides a much more limited subset of expect but works in IE 7. It looks like you guys use some of the more special parts so moving to expect.js probably wouldn't be a good idea.

I'll actually spend this weekend getting chai.expect to work in IE 7, they use a handful of easily polyfilled functions so it shouldn't be too bad.

@ghost ghost assigned kpdecker May 22, 2013
@eastridge
Copy link
Contributor Author

@GeorgeErickson @kpdecker anyone know the state of chai on IE8? Can't find any updates. On the Thorax side I think we will eventually have to care about IE8.

@eastridge
Copy link
Contributor Author

And incidentally it works on IE8, at least some simple demos do.

@akre54
Copy link
Contributor

akre54 commented Nov 6, 2013

@eastridge any luck with using an Object.create pollyfill? It looks like chai isn't doing anything particularly interesting that couldn't be stubbed with ES5-shim / ES5-sham (and since it's only being used for tests, support doesn't have to be 100%).

I can take a stab at it, but I freely admit I'm a bit lost when trying to figure out how to get Throax tests to run in the browser. Is there a wiki somewhere?

@eastridge
Copy link
Contributor Author

@akre54 If you think it's that simple I'd love for you to take a stab at that.

Re: running the tests, this is non obvious. I've added a README with notes:

https://github.com/walmartlabs/thorax/tree/master/test

@akre54
Copy link
Contributor

akre54 commented Nov 18, 2013

Welp, I forgot that Object.defineProperty only works on DOM nodes in IE8... no easy solution around this. Maybe the chai guys could add a fallback for expect(obj).to().be().truthy()?

@kpdecker
Copy link
Contributor

kpdecker commented Mar 5, 2014

@akre54 the Object.create polyfil only gets you past the first error. The much larger issue is the use of defineProperty which there doesn't seem to be a good way to work around. I believe that rewriting in expect.js is the only option given then interest that the Chai team has shown in supporting anything below IE9.

@kpdecker kpdecker removed their assignment Mar 5, 2014
kpdecker added a commit that referenced this issue Mar 6, 2014
kpdecker added a commit that referenced this issue Mar 6, 2014
Some tests were failing under IE8 due to an apparent jQuery bug with ordering of elements returned by find.

Contributes to #88
@kpdecker kpdecker closed this as completed Mar 6, 2014
@akre54
Copy link
Contributor

akre54 commented Mar 6, 2014

Yeah totally. I'm not a huge fan of Object.defineProperty because it's not always clear that the value is meant to be called as a function. It'd be nice if chai had an alternative interface like the one above, but in the meantime expect.js might be the best bet.

@kpdecker
Copy link
Contributor

kpdecker commented Mar 6, 2014

I should have been a bit clearer when I closed this. Master is running IE8 tests now.
https://travis-ci.org/walmartlabs/thorax/builds/20200198#L2040

@akre54
Copy link
Contributor

akre54 commented Mar 6, 2014

oh sweet. 👍

@kpdecker
Copy link
Contributor

kpdecker commented Apr 1, 2014

Released in v3.0.0-alpha.1

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

No branches or pull requests

4 participants