This is not yet complete, but I wanted to get something up, since it's blocking moving forward with other PRs.
The basic premise here is that it has been hard to write isolated unit tests for adding features, and the test suite as-is was more of a mixture of functional/integration tests and unit tests. I've split the unit tests out into groups and written true isolated unit tests for every method and code path.
I'm still working on trying to write the functional test for bind, but so far, even though it works in the browser, it doesn't seem to work in the test. I'm going to keep hammering on it, though.
Edit: 21 Sept 2017
It ended up being a problem with creating new instances after every test turn: I disabled that part of the afterEach block and it worked like a charm.
I'm going to leave this PR up for the rest of the week before I just land it unless someone wants to speak up and review it with me.
There are changes to the main code here, but they are functionally equivalent to what was there before–just some style and clean up changes.
Note that the karma config got a lot shorter. I plan on revisiting our CI infrastructure once I get a chance to chat with @ocombe about that, and I'll open a separate PR to get the full gamut of browsers we (really localForage and angular) support covered with some CI testing.
This is not yet complete, but I wanted to get something up, since it's blocking moving forward with other PRs.
The basic premise here is that it has been hard to write isolated unit tests for adding features, and the test suite as-is was more of a mixture of functional/integration tests and unit tests. I've split the unit tests out into groups and written true isolated unit tests for every method and code path.
I'm still working on trying to write the functional test for
bind
, but so far, even though it works in the browser, it doesn't seem to work in the test. I'm going to keep hammering on it, though.Edit: 21 Sept 2017
It ended up being a problem with creating new instances after every test turn: I disabled that part of the
afterEach
block and it worked like a charm.I'm going to leave this PR up for the rest of the week before I just land it unless someone wants to speak up and review it with me.
There are changes to the main code here, but they are functionally equivalent to what was there before–just some style and clean up changes.
Note that the karma config got a lot shorter. I plan on revisiting our CI infrastructure once I get a chance to chat with @ocombe about that, and I'll open a separate PR to get the full gamut of browsers we (really
localForage
andangular
) support covered with some CI testing.