Skip to content

feat: Implement /decode/errors endpoint #2

feat: Implement /decode/errors endpoint

feat: Implement /decode/errors endpoint #2

Triggered via pull request June 13, 2024 08:33
Status Failure
Total duration 44s
Artifacts

explorerkit-server-ci.yml

on: pull_request
run-test-cases
34s
run-test-cases
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 1 warning
Unhandled error: packages/explorerkit-server/src/core/config.ts#L10
ZodError: [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "REDIS_URL" ], "message": "Required" } ] ❯ Object.get error [as error] ../../node_modules/.pnpm/[email protected]/node_modules/zod/lib/index.mjs:587:31 ❯ ZodObject.parse ../../node_modules/.pnpm/[email protected]/node_modules/zod/lib/index.mjs:692:22 ❯ src/core/config.ts:10:36 ❯ src/core/cache.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { issues: [ { code: 'invalid_type', expected: 'string', received: 'undefined', path: [ 'REDIS_URL' ], message: 'Required' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', errors: [ { code: 'invalid_type', expected: 'string', received: 'undefined', path: [ 'REDIS_URL' ], message: 'Required' } ], format: 'Function<format>', isEmpty: false, flatten: 'Function<flatten>', formErrors: { formErrors: [], fieldErrors: { REDIS_URL: [ 'Required' ] } } } This error originated in "src/components/decoders/errors.spec.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "errors". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
Unhandled error: packages/explorerkit-server/src/core/config.ts#L10
ZodError: [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "REDIS_URL" ], "message": "Required" } ] ❯ Object.get error [as error] ../../node_modules/.pnpm/[email protected]/node_modules/zod/lib/index.mjs:587:31 ❯ ZodObject.parse ../../node_modules/.pnpm/[email protected]/node_modules/zod/lib/index.mjs:692:22 ❯ src/core/config.ts:10:36 ❯ src/core/cache.ts:2:31 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { issues: [ { code: 'invalid_type', expected: 'string', received: 'undefined', path: [ 'REDIS_URL' ], message: 'Required' } ], addIssue: 'Function<anonymous>', addIssues: 'Function<anonymous>', errors: [ { code: 'invalid_type', expected: 'string', received: 'undefined', path: [ 'REDIS_URL' ], message: 'Required' } ], format: 'Function<format>', isEmpty: false, flatten: 'Function<flatten>', formErrors: { formErrors: [], fieldErrors: { REDIS_URL: [ 'Required' ] } } } This error originated in "src/server.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "Decodes accounts correctly". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
src/server.test.ts > Server API Tests > Decodes error messages: packages/explorerkit-server/src/server.test.ts#L908
AssertionError: expected { decodedErrors: [ { …(4) }, …(3) ] } to match object { decodedErrors: [ { …(4) }, …(3) ] } (2 matching properties omitted from actual) - Expected + Received Object { "decodedErrors": Array [ Object { - "decodedData": "Slippage tolerance exceeded", "errorCode": 6001, "name": "SlippageToleranceExceeded", "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", }, null, Object { - "decodedData": "Invalid calculation", "errorCode": 6002, "name": "InvalidCalculation", "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", }, Object { "errorCode": 35, "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", }, ], } ❯ src/server.test.ts:908:22
src/components/decoders/errors.spec.ts > errors > decodeProgramError > should return the decoded error: packages/explorerkit-server/src/components/decoders/errors.spec.ts#L33
AssertionError: expected { errorCode: 6001, …(3) } to deeply equal { …(4) } - Expected + Received Object { - "decodedData": "Slippage tolerance exceeded", + "decodedMessage": "Slippage tolerance exceeded", "errorCode": 6001, "name": "SlippageToleranceExceeded", "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", } ❯ src/components/decoders/errors.spec.ts:33:22
run-test-cases
Process completed with exit code 1.
run-test-cases
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, pnpm/action-setup@v2, actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.