fix: add missing mocks for off-service.js and searchOTC in backend tests

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.
This commit is contained in:
Antoni Nuñez Romeu
2026-07-13 21:10:06 +02:00
parent 6aec9c52d0
commit 3a082877dd
+5
View File
@@ -6,6 +6,11 @@ jest.unstable_mockModule('../cima-service.js', () => ({
searchOTC: jest.fn(async () => []), searchOTC: jest.fn(async () => []),
})) }))
jest.unstable_mockModule('../off-service.js', () => ({
searchBabyProducts: jest.fn(async () => []),
getBabyProductDetails: jest.fn(async () => null),
}))
jest.unstable_mockModule('../farmacias-webhook-import.js', () => ({ jest.unstable_mockModule('../farmacias-webhook-import.js', () => ({
runFarmaciaWebhookImport: jest.fn(async () => ({})), runFarmaciaWebhookImport: jest.fn(async () => ({})),
DEFAULT_FARMACIAS_WEBHOOK: '', DEFAULT_FARMACIAS_WEBHOOK: '',