83 lines
6.0 KiB
Plaintext
83 lines
6.0 KiB
Plaintext
|
||
> @ainative-okr/backend@1.0.0 test
|
||
> export DATABASE_URL='file:./test.db' JWT_SECRET='test-secret'; npm run db:setup && prisma db seed && node --import tsx --test test/**/*.test.ts
|
||
|
||
|
||
> @ainative-okr/backend@1.0.0 db:setup
|
||
> prisma generate && node scripts/setup-sqlite.mjs
|
||
|
||
warn The configuration property `package.json#prisma` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., `prisma.config.ts`).
|
||
For more information, see: https://pris.ly/prisma-config
|
||
|
||
Environment variables loaded from .env
|
||
Prisma schema loaded from prisma/schema.prisma
|
||
|
||
✔ Generated Prisma Client (v6.19.3) to ./../node_modules/@prisma/client in 45ms
|
||
|
||
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
|
||
|
||
Tip: Want to turn off tips and other hints? https://pris.ly/tip-4-nohints
|
||
|
||
(node:19460) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||
(Use `node --trace-warnings ...` to show where the warning was created)
|
||
SQLite schema applied to /Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/backend/prisma/test.db
|
||
warn The configuration property `package.json#prisma` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., `prisma.config.ts`).
|
||
For more information, see: https://pris.ly/prisma-config
|
||
|
||
Environment variables loaded from .env
|
||
Running seed command `tsx prisma/seed.ts` ...
|
||
Seed completed successfully.
|
||
|
||
🌱 The seed command has been executed.
|
||
✔ HTTP auth, role filtering, validation, and progress update are real (602.199667ms)
|
||
✖ golden objective list response does not drift (241.03525ms)
|
||
✔ AuthService rejects invalid passwords and signs valid users (477.319291ms)
|
||
✔ ObjectivesService applies employee role filtering (3.324792ms)
|
||
✔ KeyResultsService blocks employee updates to another owner and recalculates owned progress (8.44775ms)
|
||
ℹ tests 5
|
||
ℹ suites 0
|
||
ℹ pass 4
|
||
ℹ fail 1
|
||
ℹ cancelled 0
|
||
ℹ skipped 0
|
||
ℹ todo 0
|
||
ℹ duration_ms 1529.347042
|
||
|
||
✖ failing tests:
|
||
|
||
test at test/e2e.test.ts:1:1588
|
||
✖ golden objective list response does not drift (241.03525ms)
|
||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||
+ actual - expected
|
||
... Skipped lines
|
||
|
||
'{\n' +
|
||
' "success": true,\n' +
|
||
' "data": [\n' +
|
||
' {\n' +
|
||
' "id": 1,\n' +
|
||
...
|
||
' "meta": {\n' +
|
||
+ ' "total": 3\n' +
|
||
- ' "total": 999\n' +
|
||
' }\n' +
|
||
'}\n'
|
||
|
||
at TestContext.<anonymous> (/Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/backend/test/e2e.test.ts:79:12)
|
||
at async Test.run (node:internal/test_runner/test:1113:7)
|
||
at async Test.processPendingSubtests (node:internal/test_runner/test:788:7) {
|
||
generatedMessage: true,
|
||
code: 'ERR_ASSERTION',
|
||
actual: '{\n "success": true,\n "data": [\n {\n "id": 1,\n "title": "POC AI for SQL Injection prevention",\n "quarter": "Q2/2026",\n "status": "IN_PROGRESS",\n "keyResults": [\n {\n "id": 1,\n "title": "Complete 3 POC sessions with security team",\n "progress": 33\n },\n {\n "id": 2,\n "title": "Reduce manual SQL injection review effort by 30%",\n "progress": 60\n }\n ]\n },\n {\n "id": 2,\n "title": "AI for All enablement across department",\n "quarter": "Q2/2026",\n "status": "NOT_STARTED",\n "keyResults": [\n {\n "id": 3,\n "title": "Certify 100 department members on AI for All",\n "progress": 0\n }\n ]\n },\n {\n "id": 3,\n "title": "Improve OKR operating cadence",\n "quarter": "Q2/2026",\n "status": "IN_PROGRESS",\n "keyResults": [\n {\n "id": 4,\n "title": "Reach 90% weekly OKR update compliance",\n "progress": 75\n },\n {\n "id": 5,\n "title": "Resolve stale OKR reports within two business days",\n "progress": 45\n }\n ]\n }\n ],\n "meta": {\n "total": 3\n }\n}\n',
|
||
expected: '{\n "success": true,\n "data": [\n {\n "id": 1,\n "title": "POC AI for SQL Injection prevention",\n "quarter": "Q2/2026",\n "status": "IN_PROGRESS",\n "keyResults": [\n {\n "id": 1,\n "title": "Complete 3 POC sessions with security team",\n "progress": 33\n },\n {\n "id": 2,\n "title": "Reduce manual SQL injection review effort by 30%",\n "progress": 60\n }\n ]\n },\n {\n "id": 2,\n "title": "AI for All enablement across department",\n "quarter": "Q2/2026",\n "status": "NOT_STARTED",\n "keyResults": [\n {\n "id": 3,\n "title": "Certify 100 department members on AI for All",\n "progress": 0\n }\n ]\n },\n {\n "id": 3,\n "title": "Improve OKR operating cadence",\n "quarter": "Q2/2026",\n "status": "IN_PROGRESS",\n "keyResults": [\n {\n "id": 4,\n "title": "Reach 90% weekly OKR update compliance",\n "progress": 75\n },\n {\n "id": 5,\n "title": "Resolve stale OKR reports within two business days",\n "progress": 45\n }\n ]\n }\n ],\n "meta": {\n "total": 999\n }\n}\n',
|
||
operator: 'strictEqual',
|
||
diff: 'simple'
|
||
}
|
||
npm error Lifecycle script `test` failed with error:
|
||
npm error code 1
|
||
npm error path /Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/backend
|
||
npm error workspace @ainative-okr/backend@1.0.0
|
||
npm error location /Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/backend
|
||
npm error command failed
|
||
npm error command sh -c export DATABASE_URL='file:./test.db' JWT_SECRET='test-secret'; npm run db:setup && prisma db seed && node --import tsx --test test/**/*.test.ts
|