Skip to content

Commit

Permalink
Merge pull request #5893 from nestjs/renovate/major-socket.io-packages
Browse files Browse the repository at this point in the history
fix(deps): update socket.io packages (major)
  • Loading branch information
kamilmysliwiec authored Jan 29, 2021
2 parents cb37ecb + fc56e93 commit 3ffa76f
Show file tree
Hide file tree
Showing 19 changed files with 742 additions and 12,378 deletions.
4 changes: 2 additions & 2 deletions integration/websockets/e2e/error-gateway.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as io from 'socket.io-client';
import { io } from 'socket.io-client';
import { ErrorGateway } from '../src/error.gateway';

describe('ErrorGateway', () => {
Expand All @@ -16,7 +16,7 @@ describe('ErrorGateway', () => {
});

it(`should handle error`, async () => {
const ws = io.connect('http://localhost:8080');
const ws = io('http://localhost:8080');
ws.emit('push', {
test: 'test',
});
Expand Down
8 changes: 4 additions & 4 deletions integration/websockets/e2e/gateway-ack.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as io from 'socket.io-client';
import { io } from 'socket.io-client';
import { AckGateway } from '../src/ack.gateway';

async function createNestApp(...gateways): Promise<INestApplication> {
const testingModule = await Test.createTestingModule({
providers: gateways,
}).compile();
const app = await testingModule.createNestApplication();
const app = testingModule.createNestApplication();
return app;
}

Expand All @@ -19,7 +19,7 @@ describe('WebSocketGateway (ack)', () => {
app = await createNestApp(AckGateway);
await app.listen(3000);

ws = io.connect('http://localhost:8080');
ws = io('http://localhost:8080');
await new Promise<void>(resolve =>
ws.emit('push', { test: 'test' }, data => {
expect(data).to.be.eql('pong');
Expand All @@ -32,7 +32,7 @@ describe('WebSocketGateway (ack)', () => {
app = await createNestApp(AckGateway);
await app.listen(3000);

ws = io.connect('http://localhost:8080');
ws = io('http://localhost:8080');
await new Promise<void>(resolve =>
ws.emit('push', data => {
expect(data).to.be.eql('pong');
Expand Down
12 changes: 6 additions & 6 deletions integration/websockets/e2e/gateway.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as io from 'socket.io-client';
import { io } from 'socket.io-client';
import { ApplicationGateway } from '../src/app.gateway';
import { NamespaceGateway } from '../src/namespace.gateway';
import { ServerGateway } from '../src/server.gateway';
Expand All @@ -10,7 +10,7 @@ async function createNestApp(...gateways): Promise<INestApplication> {
const testingModule = await Test.createTestingModule({
providers: gateways,
}).compile();
const app = await testingModule.createNestApplication();
const app = testingModule.createNestApplication();
return app;
}

Expand All @@ -21,7 +21,7 @@ describe('WebSocketGateway', () => {
app = await createNestApp(ApplicationGateway);
await app.listen(3000);

ws = io.connect('http://localhost:8080');
ws = io('http://localhost:8080');
ws.emit('push', {
test: 'test',
});
Expand All @@ -37,7 +37,7 @@ describe('WebSocketGateway', () => {
app = await createNestApp(ServerGateway);
await app.listen(3000);

ws = io.connect('http://localhost:3000');
ws = io('http://localhost:3000');
ws.emit('push', {
test: 'test',
});
Expand All @@ -53,8 +53,8 @@ describe('WebSocketGateway', () => {
app = await createNestApp(ApplicationGateway, NamespaceGateway);
await app.listen(3000);

ws = io.connect('http://localhost:8080');
io.connect('http://localhost:8080/test').emit('push', {});
ws = io('http://localhost:8080');
io('http://localhost:8080/test').emit('push', {});
ws.emit('push', {
test: 'test',
});
Expand Down
Loading

0 comments on commit 3ffa76f

Please sign in to comment.