P
P
pocteg2015-09-23 16:24:09
JavaScript
pocteg, 2015-09-23 16:24:09

How to test a backbone application if the API services are not yet fully ready or there are none?

Good afternoon!
We have an application html/css/javascript/backbone/gulp and so on. There is an agreement on the API, but it is not yet fully written. The question is, is it possible to emulate the server somehow? are there any utilities for this?
For example, what would the server always give one response to the same request.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
D
Denis Ineshin, 2015-09-23
@IonDen

The easiest thing is to change the URL to some local one and put a set of JSON files there. Voila!

A
Alexey Ukolov, 2015-09-23
@alexey-m-ukolov

If you are using jQuery then the best way is to use the jquery-mockjax plugin . It allows you to flexibly emulate the server API.

L
Lenar Fattakhov, 2015-09-23
@fr_end

I like this thing, very simple
https://github.com/typicode/json-server

G
Gregory, 2015-09-23
@grigruss

There is no reception against scrap: VirtualBox + Linux

K
Konstantin Kitmanov, 2015-09-23
@k12th

In fact, it can be even simpler - just redefine Backbone.sync with your own function for the duration of the tests.

A
andrewpg, 2015-09-23
@andrewpg

Microsoft fiddler to the rescue. It allows you to set responses to favorite urls

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question