From bbe157f2c61286fdedfdb9efe003ac7f1c9e51f7 Mon Sep 17 00:00:00 2001 From: saalihou Date: Fri, 8 Dec 2023 15:52:36 +0000 Subject: [PATCH] Make sure mocked api sauce has same props as real one --- package-lock.json | 4 ++-- package.json | 2 +- src/sdk/providers/__tests__/paydunya.test.ts | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2faf57..62826c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tecafrik/africa-payment-sdk", - "version": "1.0.6", + "version": "1.0.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tecafrik/africa-payment-sdk", - "version": "1.0.6", + "version": "1.0.9", "license": "MIT", "dependencies": { "apisauce": "^3.0.1", diff --git a/package.json b/package.json index 6935974..c172f75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tecafrik/africa-payment-sdk", - "version": "1.0.8", + "version": "1.0.9", "description": "A single SDK to integrate all african payment providers seamlessly", "main": "dist/index.js", "scripts": { diff --git a/src/sdk/providers/__tests__/paydunya.test.ts b/src/sdk/providers/__tests__/paydunya.test.ts index 27510cb..d7e6d05 100644 --- a/src/sdk/providers/__tests__/paydunya.test.ts +++ b/src/sdk/providers/__tests__/paydunya.test.ts @@ -15,10 +15,11 @@ import MockAdapter from "axios-mock-adapter"; let paydunyaPaymentProvider: PaydunyaPaymentProvider; let mockApi: MockAdapter; -jest.mock>("apisauce", () => { +jest.mock("apisauce", () => { + const realApisauce = jest.requireActual("apisauce"); return { + ...realApisauce, create: jest.fn((config) => { - const realApisauce = jest.requireActual("apisauce"); const api = realApisauce.create(config); mockApi = new MockAdapter(api.axiosInstance); return api;