mehpi1.0.0 • Public • Published
Simple External API Mocking via Sinon
So why another testing utility library for mocking HTTP servers? Because:
- We love sinon
- We wanted to love functional tests, but nock was unideal
- We thought, "Hey wouldn't it be cool if we could mock APIs with sinon?"
const MockAPI =const request =const sinon =
Creates a new
MockAPI instance that runs locally on the given port.
Starts the server, then calls the
Stops the server. If defined, calls the
Creates and returns a sinon stub for the given HTTP method and path.
Restores all route stubs on the mocked server.