From 181f970d6d15b91c4649dc2ba927b1233ce418a7 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 31 Dec 2024 14:56:55 +0100 Subject: [PATCH] fix socketmock --- backend/src/controllers/tests/1-clients.test.ts | 4 ++-- backend/src/controllers/tests/2-consultants.test.ts | 4 ++-- backend/src/controllers/tests/3-projectsMonth.test.ts | 4 ++-- backend/src/controllers/tests/4-projectsMonth.test.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/controllers/tests/1-clients.test.ts b/backend/src/controllers/tests/1-clients.test.ts index e7351ab9..9c801e16 100644 --- a/backend/src/controllers/tests/1-clients.test.ts +++ b/backend/src/controllers/tests/1-clients.test.ts @@ -9,7 +9,7 @@ import { ObjectID } from 'mongodb' import { IClient } from '../../models/clients' import { Jwt } from '../../models/technical' import { saveClient } from '../clients'; -import MockedSocket from 'socket.io-mock'; +import SocketMock from 'socket.io-mock'; const fakeUser: Jwt = { data: { @@ -45,7 +45,7 @@ describe('clients controller :: saveClient creation', () => { user: fakeUser, body: {...fakeClient, name: 'Company X'}, db: fakeDb, - io: new MockedSocket(), + io: new SocketMock(), } as ConfacRequest; const res = { diff --git a/backend/src/controllers/tests/2-consultants.test.ts b/backend/src/controllers/tests/2-consultants.test.ts index cb662fc7..6412b069 100644 --- a/backend/src/controllers/tests/2-consultants.test.ts +++ b/backend/src/controllers/tests/2-consultants.test.ts @@ -11,7 +11,7 @@ import { Jwt } from '../../models/technical' import { saveConsultant } from '../consultants'; import { IConsultant } from '../../models/consultants'; import { MongoMemoryServer } from 'mongodb-memory-server'; -import MockedSocket from 'socket.io-mock'; +import SocketMock from 'socket.io-mock'; const fakeUser: Jwt = { data: { _id: '_id', email: 'string', firstName: 'first', name: 'name', alias: 'alias', active: true }, @@ -30,7 +30,7 @@ const createFakeRequestAndResponse = (db: Db, consultant: Partial | user: fakeUser, body: {...fakeConsultant, ...(consultant || {})}, db, - io: new MockedSocket(), + io: new SocketMock(), } as ConfacRequest; const res = { diff --git a/backend/src/controllers/tests/3-projectsMonth.test.ts b/backend/src/controllers/tests/3-projectsMonth.test.ts index 8fbb1636..9dd50f9a 100644 --- a/backend/src/controllers/tests/3-projectsMonth.test.ts +++ b/backend/src/controllers/tests/3-projectsMonth.test.ts @@ -12,7 +12,7 @@ import request from 'supertest'; import express from 'express'; import projectsRouter from '../../routes/projects'; import bodyParser from 'body-parser'; -import MockedSocket from 'socket.io-mock'; +import SocketMock from 'socket.io-mock'; @@ -22,7 +22,7 @@ const app = express(); app.use(bodyParser.json()); app.use((req: Request, res: Response, next: NextFunction) => { req.db = getFakeDb(); - req.io = new MockedSocket(); + req.io = new SocketMock(); next(); }); app.use('/', projectsRouter); diff --git a/backend/src/controllers/tests/4-projectsMonth.test.ts b/backend/src/controllers/tests/4-projectsMonth.test.ts index fc44fc5d..04751801 100644 --- a/backend/src/controllers/tests/4-projectsMonth.test.ts +++ b/backend/src/controllers/tests/4-projectsMonth.test.ts @@ -11,7 +11,7 @@ import request from 'supertest'; import express from 'express'; import projectsRouter from '../../routes/projects'; import bodyParser from 'body-parser'; -import MockedSocket from 'socket.io-mock'; +import SocketMock from 'socket.io-mock'; @@ -21,7 +21,7 @@ const app = express(); app.use(bodyParser.json()); app.use((req: Request, res: Response, next: NextFunction) => { req.db = getFakeDb(); - req.io = new MockedSocket(); + req.io = new SocketMock(); next(); }); app.use('/', projectsRouter);