Answer the question
In order to leave comments, you need to log in
Is it possible to somehow implement such functionality of mocks for front-end development?
I would like to write a plugin for chrome on js that is universal for any projects for autonomous (from the back) development of features.
how I see it:
in the plugin I create a mock for a specific request, in it
- I specify the url on which the request is made
- the type of request (get / post / put)
- what I am passing to the request (json)
- what should be returned in response to such a request. (json)
Further, the script must be activated, and if a request is made to the server on the page that matches the specified parameters (url, type, parameter passed), it is stopped (or somehow intercepted) and somehow passed to it in response are the values that I specified in the mock.
+ the ability to create several mocks in it for different requests
Are there any considerations - is there a way to check on the client - does the request go away corresponding to the parameters and slip something specific from the client in response?
To be independent of the back and confident in the front, running the functionality on mocks.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question