Hi guys,
Currently developing a frontend application using AngularJS which connects to a backend server, I am using Nightwatch.js to check my frontend interfaces.
I would like my frontend to display fake data and think about using a mock backend. What mock server would you recommand ?
I started using nock which looks very promising, but I am facing some problem. Nock does not intercepts my HTTP requests to my backend. It might be due to selenium which proxy requests from my local machine.
Any thoughts about how to achieve this ?
Thanks,
Nock looks very nice indeed and has an extended api but it it's not well suited for your app I believe. Nock will be useful only for mocking node.js based apps/services, because it intercepts the calls to http.request and overrides their behaviour.
What you need is something built for whatever http library you're using in your frontend code. If you're using angularjs' $http module you can use ngMock.$httpBackend.
I used ngMock $httpBackend and it works fine. Thanks for your useful help !
@t00f how tool you indicate to use for mocking http requests with nightwatch?
Most helpful comment
@t00f how tool you indicate to use for mocking http requests with nightwatch?