Skip to content

Commit

Permalink
try import
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHub committed Dec 31, 2024
1 parent 181f970 commit 8f7b656
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
10 changes: 3 additions & 7 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"regenerator-runtime": "^0.13.3",
"slugify": "^1.1.0",
"socket.io": "^4.8.1",
"socket.io-mock": "^1.3.2",
"tmp": "^0.2.1",
"ubl-builder": "github:pipesanta/ubl-builder",
"uuid": "^10.0.0"
Expand Down Expand Up @@ -102,7 +103,6 @@
"lint-staged": "^10.0.1",
"mongodb-memory-server": "^8.12.1",
"nodemon": "^1.11.0",
"socket.io-mock": "^1.3.2",
"supertest": "^6.3.3",
"ts-jest": "^29.0.5",
"typescript": "4.3"
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/tests/1-clients.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ObjectID } from 'mongodb'
import { IClient } from '../../models/clients'
import { Jwt } from '../../models/technical'
import { saveClient } from '../clients';
import SocketMock from 'socket.io-mock';
import MockedSocket from 'socket.io-mock';

const fakeUser: Jwt = {
data: {
Expand Down Expand Up @@ -45,7 +45,7 @@ describe('clients controller :: saveClient creation', () => {
user: fakeUser,
body: {...fakeClient, name: 'Company X'},
db: fakeDb,
io: new SocketMock(),
io: new MockedSocket(),
} as ConfacRequest;

const res = {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/tests/2-consultants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 SocketMock from 'socket.io-mock';
import MockedSocket from 'socket.io-mock';

const fakeUser: Jwt = {
data: { _id: '_id', email: 'string', firstName: 'first', name: 'name', alias: 'alias', active: true },
Expand All @@ -30,7 +30,7 @@ const createFakeRequestAndResponse = (db: Db, consultant: Partial<IConsultant> |
user: fakeUser,
body: {...fakeConsultant, ...(consultant || {})},
db,
io: new SocketMock(),
io: new MockedSocket(),
} as ConfacRequest;

const res = {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/tests/3-projectsMonth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import request from 'supertest';
import express from 'express';
import projectsRouter from '../../routes/projects';
import bodyParser from 'body-parser';
import SocketMock from 'socket.io-mock';
import MockedSocket from 'socket.io-mock';



Expand All @@ -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 SocketMock();
req.io = new MockedSocket();
next();
});
app.use('/', projectsRouter);
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/tests/4-projectsMonth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import request from 'supertest';
import express from 'express';
import projectsRouter from '../../routes/projects';
import bodyParser from 'body-parser';
import SocketMock from 'socket.io-mock';
import MockedSocket from 'socket.io-mock';



Expand All @@ -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 SocketMock();
req.io = new MockedSocket();
next();
});
app.use('/', projectsRouter);
Expand Down

0 comments on commit 8f7b656

Please sign in to comment.