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

Update jest #863

Merged
merged 1 commit into from
Aug 27, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"husky": "^8.0.0",
"jest": "^28.1.3",
"jest": "^29.7.0",
"jest-sonar-reporter": "^2.0.0",
"lint-staged": "^13.0.2",
"nodemon": "^2.0.15",
Expand Down
22 changes: 11 additions & 11 deletions src/test/integration/controllers/cooperation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ describe('Cooperation controller', () => {
expect(response.body.count).toBe(1)
expect(Array.isArray(response.body.items)).toBe(true)
expect(response.body.items[0]).toMatchObject({
_id: testCooperation._body._id,
_id: testCooperation._body._id.toString(),
offer: {
_id: testOffer._id
_id: testOffer._id.toString()
},
initiator: testStudentUser.id,
receiver: testTutorUser._id,
initiator: testStudentUser.id.toString(),
receiver: testTutorUser._id.toString(),
additionalInfo: testCooperationData.additionalInfo,
proficiencyLevel: testCooperationData.proficiencyLevel,
price: testCooperationData.price,
Expand All @@ -223,13 +223,13 @@ describe('Cooperation controller', () => {

expect(response.status).toBe(200)
expect(response.body).toMatchObject({
_id: testCooperation._body._id,
_id: testCooperation._body._id.toString(),
offer: {
_id: testOffer._id,
author: testOffer.author
_id: testOffer._id.toString(),
author: { _id: testOffer.author.toString() }
},
initiator: testStudentUser.id,
receiver: testTutorUser._id,
receiver: testTutorUser._id.toString(),
receiverRole: tutorUserData.role[0],
additionalInfo: testCooperationData.additionalInfo,
proficiencyLevel: testCooperationData.proficiencyLevel,
Expand Down Expand Up @@ -261,10 +261,10 @@ describe('Cooperation controller', () => {
it('should create new cooperation', () => {
expect(testCooperation.status).toBe(201)
expect(testCooperation.body).toMatchObject({
_id: testCooperation._body._id,
offer: testOffer._id,
_id: testCooperation._body._id.toString(),
offer: testOffer._id.toString(),
initiator: testStudentUser.id,
receiver: testTutorUser._id,
receiver: testTutorUser._id.toString(),
receiverRole: tutorUserData.role[0],
additionalInfo: testCooperationData.additionalInfo,
proficiencyLevel: testCooperationData.proficiencyLevel,
Expand Down
4 changes: 2 additions & 2 deletions src/test/integration/controllers/finishedQuiz.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Quiz controller', () => {
let app, server, accessToken, currentUser, testFinishedQuiz, testQuiz

beforeAll(async () => {
; ({ app, server } = await serverInit())
;({ app, server } = await serverInit())
})

beforeEach(async () => {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Quiz controller', () => {
_id: expect.any(String),
createdAt: expect.any(String),
updatedAt: expect.any(String),
quiz: testQuiz._id,
quiz: testQuiz._id.toString(),
...testFinishedQuizData
})
})
Expand Down
6 changes: 3 additions & 3 deletions src/test/integration/controllers/note.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Note controller', () => {
let app, server, accessToken, testUser, testCooperation, testNote

beforeAll(async () => {
; ({ app, server } = await serverInit())
;({ app, server } = await serverInit())
})

beforeEach(async () => {
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('Note controller', () => {
firstName: expect.any(String),
lastName: expect.any(String)
},
cooperation: testCooperation._id,
cooperation: testCooperation._id.toString(),
createdAt: expect.any(String),
updatedAt: expect.any(String)
})
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('Note controller', () => {
_id: testNote._body._id,
text: expect.any(String),
author: testUser.id,
cooperation: testCooperation._id,
cooperation: testCooperation._id.toString(),
createdAt: expect.any(String),
updatedAt: expect.any(String)
})
Expand Down
4 changes: 2 additions & 2 deletions src/test/integration/controllers/notification.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Notification controller', () => {
let app, server, accessToken, currentUser, testNotification

beforeAll(async () => {
; ({ app, server } = await serverInit())
;({ app, server } = await serverInit())
})

beforeEach(async () => {
Expand Down Expand Up @@ -52,7 +52,7 @@ describe('Notification controller', () => {
expect(response.statusCode).toBe(200)
expect(response.body.count).toBe(1)
expect(response.body.items[0]).toMatchObject({
_id: testNotification._id,
_id: testNotification._id.toString(),
createdAt: expect.any(String),
updatedAt: expect.any(String),
...testNotificationData
Expand Down
Loading