Skip to content

Commit

Permalink
Make sure mocked api sauce has same props as real one
Browse files Browse the repository at this point in the history
  • Loading branch information
saalihou committed Dec 8, 2023
1 parent 44ed449 commit bbe157f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions src/sdk/providers/__tests__/paydunya.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import MockAdapter from "axios-mock-adapter";
let paydunyaPaymentProvider: PaydunyaPaymentProvider;
let mockApi: MockAdapter;

jest.mock<Pick<typeof apisauce, "create">>("apisauce", () => {
jest.mock<typeof apisauce>("apisauce", () => {
const realApisauce = jest.requireActual<typeof apisauce>("apisauce");
return {
...realApisauce,
create: jest.fn((config) => {
const realApisauce = jest.requireActual<typeof apisauce>("apisauce");
const api = realApisauce.create(config);
mockApi = new MockAdapter(api.axiosInstance);
return api;
Expand Down

0 comments on commit bbe157f

Please sign in to comment.