feat(backend): add unit tests for auth middleware and endpoints #369 #83
pr-test-gate.yml
on: pull_request
Contracts cargo test
1m 9s
Backend npm test
1m 4s
Annotations
9 errors and 2 warnings
|
Backend npm test
Process completed with exit code 1.
|
|
src/__tests__/integration/streams.test.ts > Stream Lifecycle Integration Tests > Indexer processes stream_resumed -> isPaused = false:
backend/src/workers/soroban-event-worker.ts#L886
Error: StreamResumed #999: missing body fields
❯ SorobanEventWorker.handleStreamResumed src/workers/soroban-event-worker.ts:886:13
❯ SorobanEventWorker.processEvent src/workers/soroban-event-worker.ts:272:20
❯ src/__tests__/integration/streams.test.ts:175:30
|
|
src/__tests__/integration/streams.test.ts > Stream Lifecycle Integration Tests > Indexer processes stream_paused -> isPaused = true:
backend/src/workers/soroban-event-worker.ts#L833
Error: StreamPaused #999: missing body fields
❯ SorobanEventWorker.handleStreamPaused src/workers/soroban-event-worker.ts:833:13
❯ SorobanEventWorker.processEvent src/workers/soroban-event-worker.ts:269:20
❯ src/__tests__/integration/streams.test.ts:152:30
|
|
tests/integration/streams.test.ts:
backend/src/controllers/stream.controller.ts#L1
Error: [vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock
❯ src/controllers/stream.controller.ts:1:1
Caused by: Caused by: ReferenceError: Cannot access 'mockPrisma' before initialization
❯ tests/integration/streams.test.ts:12:12
❯ src/controllers/stream.controller.ts:1:1
|
|
tests/stream.test.ts > GET /v1/users/:address/summary > returns accurate outgoing/incoming aggregates and claimable sum:
backend/tests/stream.test.ts#L235
AssertionError: expected { …(7) } to match object { …(7) }
- Expected
+ Received
Object {
"activeIncomingCount": 1,
"activeOutgoingCount": 1,
"address": "GACCURATE00000000000000000000000000000000000000000000000000",
"currentClaimable": "900",
- "totalStreamedIn": "150",
+ "totalStreamedIn": "100",
"totalStreamedOut": "50",
"totalStreamsCreated": 2,
}
❯ tests/stream.test.ts:235:27
|
|
tests/stream.test.ts > GET /v1/streams > should return 200 with list of streams:
backend/tests/stream.test.ts#L118
AssertionError: expected 500 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 500
❯ tests/stream.test.ts:118:29
|
|
tests/soroban-event-worker.test.ts > handleStreamPaused > sets isPaused:
backend/src/workers/soroban-event-worker.ts#L833
Error: StreamPaused #77: missing body fields
❯ SorobanEventWorker.handleStreamPaused src/workers/soroban-event-worker.ts:833:13
❯ tests/soroban-event-worker.test.ts:395:18
|
|
tests/soroban-event-worker.test.ts > handleStreamToppedUp > updates deposited amount:
backend/src/workers/soroban-event-worker.ts#L411
TypeError: Cannot convert undefined to a BigInt
❯ src/workers/soroban-event-worker.ts:411:67
|
|
tests/claimable.service.test.ts > ClaimableAmountService > calculates claimable amount for active stream:
backend/tests/claimable.service.test.ts#L31
AssertionError: expected '50' to be '15' // Object.is equality
Expected: "15"
Received: "50"
❯ tests/claimable.service.test.ts:31:36
|
|
Backend npm test
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions/checkout@v4, actions/setup-node@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Node.js 20 will be removed from the runner on September 16th, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
|
Contracts cargo test
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions/checkout@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Node.js 20 will be removed from the runner on September 16th, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|