mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(core): change listen to reject on server bind failures
pr update
This commit is contained in:
@@ -12,7 +12,7 @@ describe('ErrorGateway', () => {
|
||||
providers: [ErrorGateway],
|
||||
}).compile();
|
||||
app = await testingModule.createNestApplication();
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
});
|
||||
|
||||
it(`should handle error`, async () => {
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('WebSocketGateway (ack)', () => {
|
||||
|
||||
it(`should handle message with ack (http)`, async () => {
|
||||
app = await createNestApp(AckGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = io.connect('http://localhost:8080');
|
||||
await new Promise<void>(resolve =>
|
||||
@@ -30,7 +30,7 @@ describe('WebSocketGateway (ack)', () => {
|
||||
|
||||
it(`should handle message with ack & without data (http)`, async () => {
|
||||
app = await createNestApp(AckGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = io.connect('http://localhost:8080');
|
||||
await new Promise<void>(resolve =>
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('WebSocketGateway', () => {
|
||||
|
||||
it(`should handle message (2nd port)`, async () => {
|
||||
app = await createNestApp(ApplicationGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = io.connect('http://localhost:8080');
|
||||
ws.emit('push', {
|
||||
@@ -35,7 +35,7 @@ describe('WebSocketGateway', () => {
|
||||
|
||||
it(`should handle message (http)`, async () => {
|
||||
app = await createNestApp(ServerGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = io.connect('http://localhost:3000');
|
||||
ws.emit('push', {
|
||||
@@ -51,7 +51,7 @@ describe('WebSocketGateway', () => {
|
||||
|
||||
it(`should handle message (2 gateways)`, async () => {
|
||||
app = await createNestApp(ApplicationGateway, NamespaceGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = io.connect('http://localhost:8080');
|
||||
io.connect('http://localhost:8080/test').emit('push', {});
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
|
||||
|
||||
it(`should handle message (2nd port)`, async () => {
|
||||
app = await createNestApp(ApplicationGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = new WebSocket('ws://localhost:8080');
|
||||
await new Promise(resolve => ws.on('open', resolve));
|
||||
@@ -44,7 +44,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
|
||||
|
||||
it(`should handle message (http)`, async () => {
|
||||
app = await createNestApp(ServerGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
ws = new WebSocket('ws://localhost:3000');
|
||||
await new Promise(resolve => ws.on('open', resolve));
|
||||
@@ -69,7 +69,7 @@ describe('WebSocketGateway (WsAdapter)', () => {
|
||||
this.retries(10);
|
||||
|
||||
app = await createNestApp(ApplicationGateway, CoreGateway);
|
||||
await app.listenAsync(3000);
|
||||
await app.listen(3000);
|
||||
|
||||
// open websockets delay
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
||||
Reference in New Issue
Block a user