Skip to content

Improve error messages #417

Improve error messages

Improve error messages #417

Triggered via pull request November 24, 2025 05:17
Status Success
Total duration 30s
Artifacts

sca-scan.yml

on: pull_request
security-sca
27s
security-sca
Fit to window
Zoom out
Zoom in

Annotations

7 errors and 8 warnings
Content Validation - Comprehensive Test Suite > Query Validation > should validate field UID in query operations: test/unit/content-validation-comprehensive.spec.ts#L646
Error: expect(jest.fn()).toHaveBeenCalledTimes(expected) Expected number of calls: 3 Received number of calls: 1 at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/content-validation-comprehensive.spec.ts:664:26) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Content Validation - Comprehensive Test Suite > Query Validation > should validate query value types: test/unit/content-validation-comprehensive.spec.ts#L702
Error: expect(jest.fn()).toHaveBeenCalledTimes(expected) Expected number of calls: 2 Received number of calls: 4 at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/content-validation-comprehensive.spec.ts:718:26) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Query Optimization - Comprehensive Test Suite > Parameter Validation > should validate value types for comparison operations: test/unit/query-optimization-comprehensive.spec.ts#L227
Error: expect(jest.fn()).toHaveBeenCalledTimes(expected) Expected number of calls: 3 Received number of calls: 4 at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/query-optimization-comprehensive.spec.ts:243:26) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Query class > validation error handling > should throw error when whereIn() receives invalid referenceUid: test/unit/query.spec.ts#L339
Error: expect(received).toThrow(expected) Expected substring: "Invalid referenceUid: Must be alphanumeric." Received message: "Invalid referenceUid: invalid@ref!. Must be alphanumeric." 136 | // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier 137 | if (!this.isValidAlphanumeric(referenceUid)) { > 138 | throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid)); | ^ 139 | } 140 | this._parameters[referenceUid] = { '$in_query': queryInstance._parameters }; 141 | return this; at Query.whereIn (src/lib/query.ts:138:13) at test/unit/query.spec.ts:341:26 at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:74:11) at Object.throwingMatcher [as toThrow] (node_modules/expect/build/index.js:320:21) at Object.<anonymous> (test/unit/query.spec.ts:341:61) at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/query.spec.ts:341:61) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Query class > validation error handling > should throw error when whereNotIn() receives invalid referenceUid: test/unit/query.spec.ts#L344
Error: expect(received).toThrow(expected) Expected substring: "Invalid referenceUid: Must be alphanumeric." Received message: "Invalid referenceUid: invalid@ref!. Must be alphanumeric." 161 | // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier 162 | if (!this.isValidAlphanumeric(referenceUid)) { > 163 | throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid)); | ^ 164 | } 165 | this._parameters[referenceUid] = { '$nin_query': queryInstance._parameters }; 166 | return this; at Query.whereNotIn (src/lib/query.ts:163:13) at test/unit/query.spec.ts:346:26 at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:74:11) at Object.throwingMatcher [as toThrow] (node_modules/expect/build/index.js:320:21) at Object.<anonymous> (test/unit/query.spec.ts:346:64) at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/query.spec.ts:346:64) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Entries class > should log error when includeReference called with no arguments: test/unit/entries.spec.ts#L46
Error: expect(jest.fn()).toHaveBeenCalledWith(...expected) Expected: "Argument should be a String or an Array." Received: "Invalid argument. Provide a string or an array and try again." Number of calls: 1 at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/entries.spec.ts:49:29) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
Entry class > should log error when includeReference called with no arguments: test/unit/entry.spec.ts#L52
Error: expect(jest.fn()).toHaveBeenCalledWith(...expected) Expected: "Argument should be a String or an Array." Received: "Invalid argument. Provide a string or an array and try again." Number of calls: 1 at Object.<anonymous> (/home/runner/work/contentstack-typescript/contentstack-typescript/test/unit/entry.spec.ts:55:29) at Promise.then.completed (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:298:28) at new Promise (<anonymous>) at callAsyncCircusFn (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/utils.js:231:10) at _callCircusTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:316:40) at processTicksAndRejections (node:internal/process/task_queues:95:5) at _runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:252:3) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:126:9) at _runTestsForDescribeBlock (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:121:9) at run (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/run.js:71:3) at runAndTransformResultsToJestFormat (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) at jestAdapter (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) at runTestInternal (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:367:16) at runTest (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/runTest.js:444:34) at Object.worker (/home/runner/work/contentstack-typescript/contentstack-typescript/node_modules/jest-runner/build/testWorker.js:106:12)
🧾 Statement is not covered: src/lib/error-messages.ts#L25
Warning! Not covered statement
🧾 Statement is not covered: src/lib/error-messages.ts#L27
Warning! Not covered statement
🌿 Branch is not covered: src/lib/error-messages.ts#L25
Warning! Not covered branch
🌿 Branch is not covered: src/lib/error-messages.ts#L25
Warning! Not covered branch
🌿 Branch is not covered: src/lib/error-messages.ts#L27
Warning! Not covered branch
🌿 Branch is not covered: src/lib/error-messages.ts#L27
Warning! Not covered branch
🕹️ Function is not covered: src/lib/error-messages.ts#L24
Warning! Not covered function
🕹️ Function is not covered: src/lib/error-messages.ts#L26
Warning! Not covered function