-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
I'm thinking about using this repo for testing and I've encountered a problem in Jest.
If I start tests by defining a postgres mock, by PostgresMock.create()
then .listen()
and later at the end of the tests end it with .destroy()
(I don't think there's any other way to do it), then when I run the tests again (without ending the process) I get a message that the port is taken.
I reviewed the code and it seems to me that the problem is the server created in listen()
, which is not closed by destroy()
.
My solution is to save the created server in some private variable and in the destroy()
method end it with .close();
.
I tested it locally and the solution releases the port, eliminating the problem.
ZeroVocabulary
Metadata
Metadata
Assignees
Labels
No labels