Closed AndreaMontalbani closed 2 months ago
The following jest test stub does not pass, randomly, which means concurrent calls can return the same port:
test("Tests portfinder",async ()=>{ const resPorts= await Promise.all([1,2,3,4,5].map(_=>portfinder.getPortPromise({ port: 20001, stopPort: 20007 }))) expect(resPorts.length).toEqual((new Set(resPorts)).size); })
I am not sure if it is a wanted feature, seen the simple nature of the package but I needed this in a project.
Doesn't make much sense without an underlying process occupying the ports
The following jest test stub does not pass, randomly, which means concurrent calls can return the same port:
test("Tests portfinder",async ()=>{ const resPorts= await Promise.all([1,2,3,4,5].map(_=>portfinder.getPortPromise({ port: 20001,
stopPort: 20007 }))) expect(resPorts.length).toEqual((new Set(resPorts)).size); })
I am not sure if it is a wanted feature, seen the simple nature of the package but I needed this in a project.