-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
executable file
·49 lines (46 loc) · 1.38 KB
/
jest.config.ts
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
47
48
49
import type { Config } from '@jest/types';
const jestConfig: Config.InitialOptions = {
// ...Otras configuraciones
preset: 'ts-jest',
transform: {
'\\.(scss)$': 'jest-transform-stub',
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
babelConfig: true, // Utiliza la configuración de Babel del archivo babel.config.cjs
},
],
'^.+\\.js$': 'babel-jest',
'\\.(ts|tsx)$': 'ts-jest', // Mueve la configuración de ts-jest aquí,
"^.+\\.svg$": "<rootDir>/svgTransform.cjs"
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@package/(.*)$': '<rootDir>/src/components/package/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@packageTypes/(.*)$': '<rootDir>/src/packageTypes/$1',
'^@fonts/(.*)$': '<rootDir>/src/assets/scss/fonts/$1',
// Agrega más alias según tus necesidades
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: [
'**/__tests__/*.(js|ts|tsx)',
],
transformIgnorePatterns: [
'node_modules/(?!vue-multiselect)/',
],
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
globals: {
'@vue/vue3-jest': {
tsConfig: 'tsconfig.json',
},
'jest-dom': true,
},
testEnvironment: 'jsdom',
testTimeout: 90000,
};
export default jestConfig;