Reputation: 1921
Is there a way to use angular-mocks.js to invoke backend-less request mocking, testing an external site? There are plenty of examples using angular mocks on a codebase that the developer has access to add a . However, I'm stuck in a scenario... calling out to an Angular site, in the wild, which I need to test the frontend functionality, with well-known endpoints/results.
A quick fake example:
www.externalwebsite.com/RealAngularApp
www.externalwebsite.com/api/v1/getdata
that returns { id: 1, name: "testing" }
Any/all thoughts are welcome.
Thank you.
Upvotes: 0
Views: 163
Reputation: 4071
You could use the https://github.com/atecarlos/protractor-http-mock library which lets you intercept HTTP requests and serve predefined responses. Great thing about this library is that you don't have to modify your application code.
Upvotes: 2