Skip to content

Commit 08e818a

Browse files
refactor: simplify client import and update usage in market-app.utils.test.ts
1 parent 05cc1a3 commit 08e818a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

api/tests/unit/utils/market-app.utils.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ const mockClient = {
55
};
66

77
vi.mock('@contentstack/marketplace-sdk', () => ({
8-
default: {
9-
client: vi.fn(() => mockClient),
10-
},
8+
client: vi.fn(() => mockClient),
119
}));
1210

1311
vi.mock('../../../src/constants/index.js', () => ({
@@ -17,7 +15,7 @@ vi.mock('../../../src/constants/index.js', () => ({
1715
},
1816
}));
1917

20-
import contentstack from '@contentstack/marketplace-sdk';
18+
import { client as marketplaceClient } from '@contentstack/marketplace-sdk';
2119
import {
2220
getAllApps,
2321
getAppManifestAndAppConfig,
@@ -48,7 +46,7 @@ describe('market-app.utils', () => {
4846
});
4947

5048
expect(result).toEqual(mockItems);
51-
expect(contentstack.client).toHaveBeenCalledWith({
49+
expect(marketplaceClient).toHaveBeenCalledWith({
5250
authtoken: 'token-xyz',
5351
host: 'developerhub-api.contentstack.com',
5452
});
@@ -66,7 +64,7 @@ describe('market-app.utils', () => {
6664
region: 'EU',
6765
});
6866

69-
expect(contentstack.client).toHaveBeenCalledWith({
67+
expect(marketplaceClient).toHaveBeenCalledWith({
7068
authtoken: 'token',
7169
host: 'eu-developerhub-api.contentstack.com',
7270
});

0 commit comments

Comments
 (0)