forked from charmverse/app.charmverse.io
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.ts
23 lines (19 loc) · 829 Bytes
/
jest.setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// mock the db file with a prisma client that we can disconnect from the db after tests are run
// testing git diff
import { prisma } from '@charmverse/core/prisma-client';
afterAll(() => {
prisma.$disconnect();
});
// Mock external requests globally
jest.mock('lib/blockchain/getENSName', () => ({
...jest.requireActual('lib/blockchain/getENSName'),
__esModule: true,
getENSName: jest.fn().mockImplementation(() => Promise.resolve(null)),
getENSDetails: jest.fn().mockImplementation(() => Promise.resolve(null)),
resolveENSName: jest.fn().mockImplementation(() => Promise.resolve(null))
}));
jest.mock('lib/blockchain/provider/alchemy/client', () => ({
...jest.requireActual('lib/blockchain/provider/alchemy/client'),
__esModule: true,
getNFTs: jest.fn().mockImplementation(() => Promise.resolve([]))
}));