> digiboxy-accounting-backend@1.0.0 test > cross-env NODE_ENV=test jest node.exe : (node:10164) [DEP0170] DeprecationWarning: The URL sqlite::memory: is invalid. Future versions of Node.js will throw an error. At C:\Program Files\nodejs\npm.ps1:29 char:3 + & $NODE_EXE $NPM_CLI_JS $args + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ((node:10164 ) [D...throw an error.:Str ing) [], RemoteException + FullyQualifiedErrorId : NativeCommandError (Use `node --trace-deprecation ...` to show where the warning was created) console.log ✓ Database connection has been established successfully. at log (src/config/database.js:55:13) console.warn User c712ce11-88d0-4100-ad8b-49fb1fa8da44 attempted to access unauthorized company eb17538f-8680-45b5-abf7-d19a78d5273b   69 | // User requested a company they don't have access to  70 | // For now, we can throw error or fallback. Let's fallback to null or first company > 71 | console.warn(`User ${user.id} attempted to access unauthorized company ${companyIdHeader}`);  | ^  72 | }  73 | }  74 |  at warn (src/middleware/auth.js:71:17) at context (src/server.js:55:37) at ApolloServer.executeHTTPGraphQLRequest (node_modules/@apollo/server/src/ApolloServer.ts:1083:24) console.warn User c712ce11-88d0-4100-ad8b-49fb1fa8da44 attempted to access unauthorized company eb17538f-8680-45b5-abf7-d19a78d5273b   69 | // User requested a company they don't have access to  70 | // For now, we can throw error or fallback. Let's fallback to null or first company > 71 | console.warn(`User ${user.id} attempted to access unauthorized company ${companyIdHeader}`);  | ^  72 | }  73 | }  74 |  at warn (src/middleware/auth.js:71:17) at context (src/server.js:55:37) at ApolloServer.executeHTTPGraphQLRequest (node_modules/@apollo/server/src/ApolloServer.ts:1083:24) console.warn User c712ce11-88d0-4100-ad8b-49fb1fa8da44 attempted to access unauthorized company 01942d1b-5d14-4d1b-9a97-f629522f5097   69 | // User requested a company they don't have access to  70 | // For now, we can throw error or fallback. Let's fallback to null or first company > 71 | console.warn(`User ${user.id} attempted to access unauthorized company ${companyIdHeader}`);  | ^  72 | }  73 | }  74 |  at warn (src/middleware/auth.js:71:17) at context (src/server.js:55:37) at ApolloServer.executeHTTPGraphQLRequest (node_modules/@apollo/server/src/ApolloServer.ts:1083:24) console.warn User c712ce11-88d0-4100-ad8b-49fb1fa8da44 attempted to access unauthorized company 01942d1b-5d14-4d1b-9a97-f629522f5097   69 | // User requested a company they don't have access to  70 | // For now, we can throw error or fallback. Let's fallback to null or first company > 71 | console.warn(`User ${user.id} attempted to access unauthorized company ${companyIdHeader}`);  | ^  72 | }  73 | }  74 |  at warn (src/middleware/auth.js:71:17) at context (src/server.js:55:37) at ApolloServer.executeHTTPGraphQLRequest (node_modules/@apollo/server/src/ApolloServer.ts:1083:24) console.error GraphQL Error: { message: 'Account code already exists in this company', locations: [ { line: 3, column: 13 } ], path: [ 'createAccount' ], extensions: { code: 'INTERNAL_SERVER_ERROR' } }   22 | resolvers,  23 | formatError: (error) => { > 24 | console.error('GraphQL Error:', error);  | ^  25 | return {  26 | message: error.message,  27 | locations: error.locations, at error (src/server.js:24:13) at node_modules/@apollo/server/src/errorNormalize.ts:41:16 at Array.map () at normalizeAndFormatErrors (node_modules/@apollo/server/src/errorNormalize.ts:39:29) at formatErrors (node_modules/@apollo/server/src/requestPipeline.ts:688:36) at processGraphQLRequest (node_modules/@apollo/server/src/requestPipeline.ts:484:11) at internalExecuteOperation (node_modules/@apollo/server/src/ApolloServer.ts:1334:12) at runHttpQuery (node_modules/@apollo/server/src/runHttpQuery.ts:232:27) at runPotentiallyBatchedHttpQuery (node_modules/@apollo/server/src/httpBatching.ts:85:12) at ApolloServer.executeHTTPGraphQLRequest (node_modules/@apollo/server/src/ApolloServer.ts:1109:14) console.error [ { "message": "Account code already exists in this company", "locations": [ { "line": 3, "column": 13 } ], "path": [ "createAccount" ] } ]   169 | });  170 | > 171 | if (res.body.errors) console.error(JSON.stringify(res.body.errors, null, 2));  | ^  172 |  173 | expect(res.body.data.createAccount).toBeDefined();  174 | expect(res.body.data.createAccount.code).toBe('1001'); at Object.error (src/tests/integration/multi-company.test.js:171:36) FAIL src/tests/integration/mult i-company.test.js Multi-Company Integration √ Create Account in Company A (49 ms) √ Verify Account in Company A (21 ms) × Verify Account NOT in Company B (17 ms) × Create Account in Company B (Same Code) (34 ms) ● Multi-Company Integration › Verify Account NOT in Company B expect(received).toHaveLeng th(expected) Expected length: 0 Received length: 1 Received array: [{"code": "1001"}]   137 |  138 | const accounts = res.body [33m.data.accoun ts; > 139 | expect(accounts) .toHaveLength(0 [39m); // Should be empty as we haven't created any in B  | ^  140 | });  141 |  142 | test('Create Account in Company B (Same Code)', async () => { at Object.toHaveLength (s rc/tests/integration/multi-comp any.test.js:139:22) ● Multi-Company Integration › Create Account in Company B (Same Code) TypeError: Cannot read properties of null (reading 'createAccount')   171 | if (res.bo dy.errors) console[3 3m.error(JSON[3 3m.stringify(res.[39 mbody.errors,[3 9m null, 2));  172 | > 173 | expect(res[33 m.body.data .createAccount). toBeDefined();  | ^  174 | exp ect(res.body.[3 9mdata.createAccount [33m.code).toBe( '1001');  175 | exp ect(res.body.[3 9mdata.createAccount [33m.nameId).toB e('Kas B');  176 | }); at Object.createAccount ( src/tests/integration/multi-com pany.test.js:173:28) Test Suites: 1 failed, 1 total Tests: 2 failed, 2 passed, 4 total Snapshots: 0 total Time: 4.297 s Ran all test suites.