aaronpowell / db.js

db.js is a wrapper for IndexedDB to make it easier to work against
http://aaronpowell.github.com/db.js/
MIT License
820 stars 142 forks source link

Supporting PhantomJS for running tests #167

Closed aaronpowell closed 8 years ago

aaronpowell commented 8 years ago

This should close #113

aaronpowell commented 8 years ago

@brettz9 I've got PhantomJS tests running now as part of the build now, but as you can see from the last test run it failed.

I can repo the failure locally and it's because these two expect's fail:

expect(ev.oldVersion).to.equal(initialVersion);
expect(ev.newVersion).to.equal(null);

I'd say there's something going amiss in the err.resume stuff. That's from one of the recent PR's right? Any thought on it?

aaronpowell commented 8 years ago

Ok so I'm thinking:

I'm leaning towards the former

brettz9 commented 8 years ago

It's not a bug in our code; it's a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1220279 . It works fine in Chrome. Those checks are in blocked-events.js. I don't think the test should patch it, since it really is what is expected.

aaronpowell commented 8 years ago

Regarding the FF bug - sure, but one of the things I tried to solve in db.js at the start was to normalise the quirks across browsers (back when there was the setVersion vs onversionchange events, and such).

Now there's less quirks (except IE/Edge not supporting multi-key indexes) but something like this I'd like to normalise down where possible, so if I can patch it in db.js's core then that meets that goal.

brettz9 commented 8 years ago

Oh, patching it within db.js--was thinking you were talking about the tests...Gotcha... Cool...

aaronpowell commented 8 years ago

Check out 2e091af it has the patch I'm talking about in there.

aaronpowell commented 8 years ago

@MartijnR you might be interested in what's happening here.

brettz9 commented 8 years ago

Yeah, that's cool. Maybe a comment would be nice with the bug link though in case this gets fixed in the future and therefore no longer any need to keep patching.