Closed halfdan closed 9 years ago
100% yes.
Best bet is to just stub/mock the goinstant API for unit tests. We have done this in various other projects:
https://github.com/goinstant/goangular https://github.com/goinstant/user-list https://github.com/goinstant/webrtc
I've begun to pull together the 'sunny day' functional tests in PR #65.
I'm experimenting with Dalek; it's too early to say whether we'll be able to carry it into production, but it provides a shiny Phantom abstraction, and allows us to leverage Sauce Labs.
As @halfdan suggested above, I'm using a 'dummy' GI account and I'm hopping over authentication (just generating a JWT manually, though we should probably stub the providers at some point).
I've temporarily dumped the configuration into ouija.json, we'll want a separate configuration for testing, where should we drop it? Also, we're going to have to touch instantiation to add these tests, that should make #65 easy to implement :)
This is my first tango with functional tests. Suggestions welcome.
The test config should probably be in config/
, maybe a standalone tests.json
?
Should we mirror Ghost by renaming 'app' to 'core' and moving the 'test' directory into it too?
We should add functional tests using PhantomJS/CasperJS. This would most likely require a dummy account for GoInstant in order to test loading/posting comments.
An alternative would be to stub all API requests/responses. This would include faking authentication with all supported identity providers.