8.2 KiB
STEP 12: Run Tests Report
Commands: npm run build ; npm test Exit codes: 0, 0 Accepted implementation: yes
Output
$ npm run build
build npm run build -w @ainative-okr/backend && npm run build -w @ainative-okr/frontend
@ainative-okr/backend@1.0.0 build prisma generate && tsc -p tsconfig.build.json
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (v6.19.3) to ./../../../node_modules/@prisma/client in 92ms
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
@ainative-okr/frontend@1.0.0 build tsc -b && vite build
vite v5.4.21 building for production... transforming... ✓ 162 modules transformed. rendering chunks... computing gzip size... dist/index.html 0.40 kB │ gzip: 0.27 kB dist/assets/index-BMPUmgei.css 12.42 kB │ gzip: 3.11 kB dist/assets/index-Cfmh-34d.js 351.46 kB │ gzip: 109.32 kB ✓ built in 1.19s
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
$ npm test
test npm test -w @ainative-okr/backend && npm test -w @ainative-okr/frontend
@ainative-okr/backend@1.0.0 test npm run db:setup && npm run seed:test && cross-env DATABASE_URL=file:./test.db JWT_SECRET=test-secret node --import tsx --test test/services.test.ts test/e2e.test.ts test/llm-judge.test.ts
@ainative-okr/backend@1.0.0 db:setup npm run gen:sqlite-schema && prisma generate --schema prisma/schema.sqlite.prisma && cross-env DATABASE_URL=file:./test.db prisma db push --schema prisma/schema.sqlite.prisma --force-reset --skip-generate --accept-data-loss
@ainative-okr/backend@1.0.0 gen:sqlite-schema node scripts/make-sqlite-schema.mjs
Wrote /Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/apps/okr/backend/prisma/schema.sqlite.prisma (sqlite provider) from schema.prisma Prisma schema loaded from prisma/schema.sqlite.prisma
✔ Generated Prisma Client (v6.19.3) to ./../../../node_modules/@prisma/client in 72ms
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
Tip: Interested in query caching in just a few lines of code? Try Accelerate today! https://pris.ly/tip-3-accelerate
Prisma schema loaded from prisma/schema.sqlite.prisma Datasource "db": SQLite database "test.db" at "file:./test.db"
The SQLite database "test.db" at "file:./test.db" was successfully reset.
🚀 Your database is now in sync with your Prisma schema. Done in 14ms
@ainative-okr/backend@1.0.0 seed:test cross-env DATABASE_URL=file:./test.db JWT_SECRET=test-secret node --import tsx prisma/seed.ts
Seed completed successfully. ✔ unauthenticated requests are rejected with 401 (172.109166ms) ✔ GET /objectives employee sees only own objectives (426.861791ms) ✔ GET /objectives manager sees all objectives (1157.492792ms) ✔ GET /objectives?quarter= filters to matching quarter only (327.964625ms) ✔ GET /objectives/:id returns objective with computedProgress and relations (352.261875ms) ✔ GET /objectives/:id returns 404 for non-existent objective (444.636416ms) ✔ GET /objectives/:id returns 403 when employee accesses another owner objective (351.875667ms) ✔ POST /objectives returns 400 for empty title (370.650875ms) ✔ POST /objectives returns 400 for invalid quarter format (369.342625ms) ✔ POST /objectives manager creates objective and receives it with NOT_STARTED status (380.596ms) ✔ POST /objectives returns 403 when employee creates for another user (340.38575ms) ✔ POST /objectives returns 404 for non-existent owner (350.651625ms) ✔ GET /key-results/:id returns KR with nested objective (357.710833ms) ✔ GET /key-results/:id returns 404 for non-existent KR (316.1865ms) ✔ GET /key-results/:id returns 403 when employee reads another owner KR (345.550208ms) ✔ POST /key-results employee creates KR on own objective (360.720209ms) ✔ POST /key-results returns 403 when employee creates KR on another owner objective (337.912167ms) ✔ PATCH /key-results/:id/progress updates progress and returns updated KR (382.429875ms) ✔ PATCH /key-results/:id/progress returns 400 for out-of-range values (369.492959ms) ✔ PATCH /key-results/:id/progress returns 403 when employee updates another owner KR (358.577584ms) ✔ PATCH /key-results/:id/progress returns 404 for non-existent KR (718.129958ms) ✔ golden: manager objective list does not drift (370.856042ms) ✔ golden: employee objective list does not drift (357.055625ms) ✔ golden: objective detail (GET /objectives/1) does not drift (367.342042ms) ﹣ LLM judge: manager objective list passes all semantic invariants (0.362625ms) # Set ANTHROPIC_API_KEY to enable the LLM-judge gate ﹣ LLM judge: employee objective list passes all semantic invariants (0.05025ms) # Set ANTHROPIC_API_KEY to enable the LLM-judge gate ﹣ LLM judge: objective detail passes all semantic invariants (0.045708ms) # Set ANTHROPIC_API_KEY to enable the LLM-judge gate ✔ AuthService rejects invalid password with UnauthorizedException (351.825917ms) ✔ AuthService rejects non-existent user with UnauthorizedException (2.384291ms) ✔ AuthService accepts correct credentials and returns signed JWT (325.370917ms) ✔ AuthService accepts login by email as well as username (1139.329791ms) ✔ ObjectivesService.list employee sees only own objectives (2.531208ms) ✔ ObjectivesService.list manager sees all objectives (5.079792ms) ✔ ObjectivesService.list quarter filter narrows results to matching quarter only (6.193708ms) ✔ ObjectivesService.getById returns objective with computedProgress (3.766042ms) ✔ ObjectivesService.getById employee accessing own objective succeeds (2.305791ms) ✔ ObjectivesService.getById employee accessing another user objective throws ForbiddenException (3.020833ms) ✔ ObjectivesService.getById non-existent id throws NotFoundException (2.215667ms) ✔ ObjectivesService.create sets status to NOT_STARTED and loads relations (8.258375ms) ✔ ObjectivesService.create employee creating for another user throws ForbiddenException (1.617375ms) ✔ ObjectivesService.create with non-existent owner throws NotFoundException (2.16625ms) ✔ KeyResultsService.getById returns KR with nested objective and owner (3.454208ms) ✔ KeyResultsService.getById employee reading another owner KR throws ForbiddenException (2.787667ms) ✔ KeyResultsService.getById non-existent id throws NotFoundException (2.847833ms) ✔ KeyResultsService.updateProgress blocks employee updating KR from another owner (6.831375ms) ✔ KeyResultsService.updateProgress records new progress value and creates ProgressUpdate (12.313709ms) ✔ KeyResultsService.updateProgress non-existent KR throws NotFoundException (1.932584ms) ✔ KeyResultsService status recalculation: NOT_STARTED → IN_PROGRESS → COMPLETED → IN_PROGRESS (34.320583ms) ✔ KeyResultsService averageProgress: multi-KR completion drives COMPLETED status (24.039875ms) ℹ tests 49 ℹ suites 0 ℹ pass 46 ℹ fail 0 ℹ cancelled 0 ℹ skipped 3 ℹ todo 0 ℹ duration_ms 10780.965083
@ainative-okr/frontend@1.0.0 test vitest run
RUN v3.2.6 /Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/apps/okr/frontend
✓ src/tests/okr.test.tsx (16 tests) 26ms
Test Files 1 passed (1) Tests 16 passed (16) Start at 15:39:53 Duration 965ms (transform 48ms, setup 51ms, collect 146ms, tests 26ms, environment 254ms, prepare 44ms)
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
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