Port wildcard support for nockBack mocks
See original GitHub issueContext
Currently you need to explicitly manage port on which your test application is running when executing nockBack mocks so that recorded port matches the one you are currently running application on. This is a major inconvenience since supertest
randomizes execution port.
It should be possible to specify wildcard port (*) that would match request against any possible port value or possibly its absence. Alternatively a parameter that would accept any port or its absence when no port is specified could also be a solution.
Alternatives
It is possible to manually launch and stop server for application under test that would be listening to specific port, but starting and stopping server manually is both introducing additional boilerplate and is not even that easy when you are executing multiple tests in parallel (as then you have to solve port collision problem yourself).
If the feature request is accepted, would you be willing to submit a PR?
Yes
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
@gr2m I would be happy to. Please ping me when there will be something I could be moving it to.
The problem is that the code base is really hard to work with. So I couldn’t figure out where the appropriate place to add this feature was
But the request is very much still relevant