fix/backend-test-mocks #34

Merged
Ichitux merged 13 commits from fix/backend-test-mocks into main 2026-07-13 19:20:44 +00:00
Owner
No description provided.
Ichitux added 12 commits 2026-07-13 19:10:57 +00:00
- transformOFFProduct: maps OFF products to unified Product model
- searchBabyProducts: searches baby products via OFF API (1h cache)
- getBabyProductDetails: fetches product details by barcode (1h cache)
- 9 tests passing for transform logic and input validation
- GET /api/products/search?q={query} - parallel search across both sources
- GET /api/products/:source/:id - product detail by source (cima/openfoodfacts)
- Uses Promise.allSettled for fault-tolerant parallel search
- Added imports for searchOTC and OFF service functions
Displays CIMA OTC and Open Food Facts baby products with source/category
badges, product images, brand info, and Nutri-Score for OFF items.
fix: add missing mocks for off-service.js and searchOTC in backend tests
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
20cc399731
The backend test was hanging in CI because server.js imports off-service.js
which pulls in redis-client.js. Without a mock, it tries to connect to Redis
at import time, hanging indefinitely in CI where no Redis server exists.

Also added the missing searchOTC mock for cima-service.js to fix the
SyntaxError from the export mismatch.
Ichitux added 1 commit 2026-07-13 19:16:52 +00:00
ci: consolidate test jobs into single workflow with npm caching
Run Tests on Branches / Run Tests (push) Successful in 1m44s
5ae3ebecee
- Merge 3 parallel test jobs (backend/frontend/mobile) into one sequential job
- Remove dependency on dorny/paths-filter@v3 (replaced with git diff script)
- Add npm cache via setup-node to speed up dependency installation
- Downgrade Node.js from 24 to 22 LTS for stability
- Reduce checkout fetch-depth from full history to 2 commits
Ichitux merged commit 4370d3c35c into main 2026-07-13 19:20:44 +00:00
Ichitux deleted branch fix/backend-test-mocks 2026-07-13 19:20:44 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Ichitux/FarmaFinder#34