-
Notifications
You must be signed in to change notification settings - Fork 0
05 Endpoint Imposter
Endpoint Imposter provides declarative yet stateful API mocks.
This very distribution of tools doesn't perform many custom operations. It's more of a glue among the tested app, the tests themselves and the mocks.
With frontend testing tools you don't have to worry about starting the mocked server. It'll start and stop automatically when you run your tests.
With frontend testing tools you don't have to manually prefix mocks so that they don't colide. Simply place a rest.js
file next to your test.js
file and the mocks exported by it will be prefixed automatically.
With frontend testing tools you don't have to install endpoint-imposter-utils yourself. They are installed for you and exposed through one of the built-in modules (ei).
All you have to do, after you set up your app to be testable, is to:
- Create a
rest.js
file that exports some mocks likemodule.exports = [{request, response}]
- Link your app to the mocked server like that:
.setupStart().eiUse().setupFinish()
Everything else is just regular Endpoint Imposter stuff which you can learn more about from the official documentation of Endpoint Imposter