Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update socket.io packages (major) #5893

Merged
merged 3 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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