forked from Stellar-split/split-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.setup.ts
More file actions
22 lines (20 loc) · 931 Bytes
/
Copy pathvitest.setup.ts
File metadata and controls
22 lines (20 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import '@testing-library/jest-dom';
import { vi } from 'vitest';
(globalThis as any).jest = vi as any;
vi.mock('@stellar/freighter-api', () => ({
getPublicKey: vi.fn().mockResolvedValue('GTEST_PUBLIC_KEY'),
signTransaction: vi.fn().mockResolvedValue('signed_xdr'),
signBlob: vi.fn().mockResolvedValue({ signedBlob: '' }),
signAuthEntry: vi.fn().mockResolvedValue({ signedAuthEntry: '' }),
isConnected: vi.fn().mockResolvedValue({ isConnected: false }),
isAllowed: vi.fn().mockResolvedValue({ isAllowed: false }),
setAllowed: vi.fn().mockResolvedValue({ isAllowed: false }),
getNetwork: vi.fn().mockResolvedValue({ networkUrl: '', network: 'TESTNET' }),
getNetworkDetails: vi.fn().mockResolvedValue({
network: 'TESTNET',
networkUrl: '',
networkPassphrase: 'Test SDF Network ; September 2015',
sorobanRpcUrl: '',
}),
WatchWalletChanges: vi.fn().mockReturnValue({ unsubscribe: vi.fn() }),
}));