My scene is to use it as API server so the front-end can make mock-test. that means, my url may be very complex, but in fact I have only several json files to show data.
for instance:
my api url: http://some.com/api/version1.0/food
my json file: /data/mock/food.json
When I run http-server, i don't want to make-up the path with many useless empty dirs to match the url, i just want to use the simple and existing dir. How do i make this ? many thanks !
You should mock the request function when running frontend tests. In there, you can assert that they are called with the right arguments.
Most helpful comment
You should mock the request function when running frontend tests. In there, you can assert that they are called with the right arguments.