forked from coinbase/build-onchain-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
25 lines (24 loc) · 898 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
const customJestConfig = {
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/node_modules/**'],
coverageReporters: ['clover', 'json', 'lcov', 'text'],
moduleNameMapper: {
'@coinbase/onchainkit/wallet':
'<rootDir>/node_modules/@coinbase/onchainkit/esm/wallet',
},
roots: ['<rootDir>/src', '<rootDir>/app/api/paymaster-proxy'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
};
const asyncConfig = createJestConfig(customJestConfig);
module.exports = async () => {
const config = await asyncConfig();
config.transformIgnorePatterns = [
// this is one of wagmi's deps. It's a native ES module, and jest doesn't
// currently support those. Adding it here transpiles it before running tests.
'node_modules/@tanstack/query-sync-storage-persister',
];
return config;
};