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:
@@ -3,6 +3,12 @@ import { jest } from '@jest/globals'
|
|||||||
jest.unstable_mockModule('../cima-service.js', () => ({
|
jest.unstable_mockModule('../cima-service.js', () => ({
|
||||||
searchMedicines: jest.fn(async () => []),
|
searchMedicines: jest.fn(async () => []),
|
||||||
getMedicineDetails: jest.fn(async () => null),
|
getMedicineDetails: jest.fn(async () => null),
|
||||||
|
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', () => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user