-
Notifications
You must be signed in to change notification settings - Fork 327
/
Copy pathjest.config.js
46 lines (43 loc) · 1.42 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
const { name } = require('./package.json');
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
displayName: name.replace('@clerk', ''),
injectGlobals: true,
globals: {
__PKG_NAME__: '@clerk/clerk-js',
__PKG_VERSION__: 'test',
},
testEnvironment: '<rootDir>/jest.jsdom-with-timezone.ts',
roots: ['<rootDir>/src'],
setupFiles: ['./jest.setup.ts'],
setupFilesAfterEnv: ['./jest.setup-after-env.ts'],
testRegex: [
'/__tests__/(.+/)*.*.test.[jt]sx?$',
'/ui/.*/__tests__/.*.test.[jt]sx?$',
'/(core|utils)/.*.test.[jt]sx?$',
],
testPathIgnorePatterns: ['/node_modules/'],
collectCoverage: false,
coverageProvider: 'v8',
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: ['/node_modules/'],
// collectCoverageFrom: [
// '**/*.{js,jsx,ts,tsx}',
// '!**/*.d.ts',
// '!**/index.ts',
// '!**/index.browser.ts',
// '!**/index.headless.ts',
// '!**/index.headless.browser.ts',
// '!**/coverage/**',
// '!**/dist/**',
// '!**/node_modules/**',
// ],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\](?!(@formkit/auto-animate/react)).+\\.(js|jsx|mjs|cjs|ts|tsx)$'],
moduleDirectories: ['node_modules', '<rootDir>/src'],
transform: {
'^.+\\.m?tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json', diagnostics: false }],
// '^.+\\.m?tsx?$': ['@swc/jest'],
'^.+\\.svg$': '<rootDir>/svgTransform.js',
},
};
module.exports = config;