-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
-
Move code from
packages/loopback/test/supporttopackages/testlab -
Drop
Clientclass in favour of supertest -
Add helper APIs for setting up server + supertest:
Given a LoopBack app, start it on an ephemeral port (listen(0)), wait until it's listening and then return asupertestinstance pointing to this server. (This is useful for testing LoopBack apps.)- Given a low-level
http.Serverinstance, start it on an ephemeral port (listen(0)), wait until it's listening and then return asupertestinstance pointing to this server. (This is useful e.g. for testing SwaggerRouter in isolation.)
These two helpers should share most of the implementation code.
Background info from #135:
- Rework tests to use supertest instead of request. Request's interface is already showing limitations, it's time to move to something better while the amount of needed changes is low.
- Consider adding supertest to testlab, this makes sense when we also add helpers for setting up HTTP server for a loopback app/router and returning a supertest instance connected to that server.
cc @ritch @superkhau
superkhau