Refactor test files for improved readability and consistency - #158
Open
Copstud3 wants to merge 4 commits into
Open
Refactor test files for improved readability and consistency#158Copstud3 wants to merge 4 commits into
Copstud3 wants to merge 4 commits into
Annotations
5 errors and 1 warning
|
Run tests
Process completed with exit code 1.
|
|
Run tests:
tests/unit/credential.controller.test.ts#L258
AssertionError: expected "vi.fn()" to be called with arguments: [ { success: true, …(1) } ]
Number of calls: 0
❯ tests/unit/credential.controller.test.ts:258:33
|
|
Run tests:
tests/integration/isolation.test.ts#L51
PrismaClientKnownRequestError:
Invalid `prisma!.user.delete()` invocation in
/home/runner/work/learnault-api/learnault-api/tests/integration/isolation.test.ts:51:24
48 expect(user.username).toBe(userData.username)
49 expect(user.role).toBe('LEARNER')
50
→ 51 await prisma!.user.delete(
An operation failed because it depends on one or more records that were required but not found. No record was found for a delete.
❯ zr.handleRequestError node_modules/.pnpm/@prisma+client@7.4.2_prisma@7.4.2_@types+react@19.2.14_react-dom@19.2.4_react@19.2.4__r_49b4b128965f74ea9bbd7586bc0c7d7a/node_modules/@prisma/client/runtime/client.js:65:8286
❯ zr.handleAndLogRequestError node_modules/.pnpm/@prisma+client@7.4.2_prisma@7.4.2_@types+react@19.2.14_react-dom@19.2.4_react@19.2.4__r_49b4b128965f74ea9bbd7586bc0c7d7a/node_modules/@prisma/client/runtime/client.js:65:7581
❯ zr.request node_modules/.pnpm/@prisma+client@7.4.2_prisma@7.4.2_@types+react@19.2.14_react-dom@19.2.4_react@19.2.4__r_49b4b128965f74ea9bbd7586bc0c7d7a/node_modules/@prisma/client/runtime/client.js:65:7288
❯ a node_modules/.pnpm/@prisma+client@7.4.2_prisma@7.4.2_@types+react@19.2.14_react-dom@19.2.4_react@19.2.4__r_49b4b128965f74ea9bbd7586bc0c7d7a/node_modules/@prisma/client/runtime/client.js:75:5816
❯ tests/integration/isolation.test.ts:51:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'P2025', meta: { modelName: 'User', operation: 'a delete' }, clientVersion: '7.4.2', batchRequestIdx: undefined }
|
|
Run tests:
tests/referral.controller.test.ts#L211
AssertionError: expected "vi.fn()" to be called with arguments: [ ObjectContaining{…} ]
Received:
1st vi.fn() call:
[
- ObjectContaining {
- "data": ObjectContaining {
+ {
+ "data": {
"activeReferrals": 1,
- "earnedBonuses": 5,
+ "earnedBonuses": "0.0000000",
+ "pendingBonuses": "5.0000000",
"totalReferrals": 2,
},
"success": true,
},
]
Number of calls: 1
❯ tests/referral.controller.test.ts:211:24
|
|
Run tests:
tests/data-export.service.test.ts#L156
AssertionError: expected 'pending' to be 'ready' // Object.is equality
Expected: "ready"
Received: "pending"
❯ tests/data-export.service.test.ts:156:37
|
|
Complete job
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-node@v4, actions/upload-artifact@v4, pnpm/action-setup@v4. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
background
wait
wait-all
cancel
parallel
Loading