Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
johns
on May 3, 2013
|
parent
|
context
|
favorite
| on:
Mock your HTTP responses to test your REST API
What do you use for your existing tests? VCR?
city41
on May 3, 2013
[–]
We've rolled our own system inside Jasmine that mocks out XHR. It's generally in the form of:
@ajax.whenQuerying('someendpoint').respondWith(someData)
And internal to that system we have some components that understand the overall shape of our data model so someData can be a very small, simple object with just the data the test cares about and the internals flesh out the rest.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: