elwayman02 / ember-data-twitch

Ember-Data Abstractions for the Twitch API
http://github.jhawk.co/ember-data-twitch/
MIT License
3 stars 2 forks source link

Improve test harness #2

Open elwayman02 opened 8 years ago

elwayman02 commented 8 years ago

Integrate either ember-cli-mirage or ember-sinon-qunit (or both)

Mirage approach allows us to utilize fake servers to truly mock out the behavior of this addon. As a downside, though, we'll have to maintain accurate factories for what each payload should look like.

Sinon allows us to just mock out our custom methods as unit tests and trust that the AJAX calls are correct (we don't need to test Ember-Data, necessarily). This is faster and more efficient, but may be less robust.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35874746-improve-test-harness?utm_campaign=plugin&utm_content=tracker%2F40840590&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40840590&utm_medium=issues&utm_source=github).
BrianSipple commented 8 years ago

I think Mirage could be really useful — especially for potentially allowing the dummy app to mock server interactions for authorization.

That said, I also agree that sinon will cover MANY of our needs and the greater efficiency is a big plus.

So... I think if we kept both points in mind, we could limit Mirage to acceptance tests and just make sure that we keep those light while focusing mainly on our individual adapter functions.