Skip to content

Commit

Permalink
chore: delete jest of package bridge and replace vi.Mock with Mock
Browse files Browse the repository at this point in the history
  • Loading branch information
aelf-lxy committed Dec 2, 2024
1 parent 576ce04 commit 17ec80f
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 453 deletions.
6 changes: 0 additions & 6 deletions packages/bridge/coverage/coverage-summary.json

This file was deleted.

45 changes: 0 additions & 45 deletions packages/bridge/jest-report.xml

This file was deleted.

205 changes: 0 additions & 205 deletions packages/bridge/jest.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
"dependencies": {
"@aelf-web-login/wallet-adapter-base": "workspace:*",
"@aelf-web-login/tools": "workspace:*",
"@portkey/contracts": "^2.15.9",
"@portkey/services": "^2.15.9",
"@reduxjs/toolkit": "^2.2.3",
Expand Down
9 changes: 4 additions & 5 deletions packages/bridge/src/__tests__/useVerifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import useVerifier from '../useVerifier';
import { did, ConfigProvider, useVerifyToken, IVerifier } from '@portkey/did-ui-react';
import { TChainId } from '@aelf-web-login/wallet-adapter-base';
import { OperationTypeEnum } from '@portkey/services';
import type { Mock } from 'vitest';

vi.mock('@portkey/did-ui-react', () => ({
did: {
Expand Down Expand Up @@ -52,11 +53,9 @@ describe('useVerifier', () => {
};

beforeEach(() => {
(did.services.getRecommendationVerifier as vi.Mock).mockReturnValue(
mockGetRecommendationVerifier,
);
(ConfigProvider.getSocialLoginConfig as vi.Mock).mockReturnValue(mockSocialLoginConfig);
(useVerifyToken as vi.Mock).mockReturnValue(mockVerifyToken);
(did.services.getRecommendationVerifier as Mock).mockReturnValue(mockGetRecommendationVerifier);
(ConfigProvider.getSocialLoginConfig as Mock).mockReturnValue(mockSocialLoginConfig);
(useVerifyToken as Mock).mockReturnValue(mockVerifyToken);
});

it('should return getRecommendationVerifier and verifySocialToken functions', () => {
Expand Down
Loading

0 comments on commit 17ec80f

Please sign in to comment.