-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.config.js
46 lines (46 loc) · 1.34 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** @type {import('jest').Config} */
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts', '.tsx', '.mts', '.js', '.jsx', '.mjs'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
'^(\\.{1,2}/.*)\\.jsx?$': '$1',
'^(\\.{1,2}/.*)\\.tsx?$': '$1',
},
transform: {
'^.+\\.(t|j)sx?$': ['ts-jest', {
useESM: true,
tsconfig: 'tsconfig.json',
isolatedModules: true
}],
},
transformIgnorePatterns: [
'node_modules/(?!(@solana|@project-serum|@metaplex|@coral-xyz|@holaplex|@nfteyez)/.*)'
],
testEnvironmentOptions: {
url: "http://localhost"
},
resolver: "jest-ts-resolver",
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'mjs'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,ts}',
'<rootDir>/src/**/*.{spec,test}.{js,ts}'
],
coverageDirectory: 'coverage',
coverageProvider: 'v8',
coverageReporters: ['text', 'lcov'],
collectCoverageFrom: [
'src/**/*.{js,ts}',
'!src/**/*.d.ts',
'!src/**/*.test.{js,ts}',
'!src/types/**/*',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
useESM: true
}
}
}