1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-23 09:45:56 +01:00
blog/jest.config.js

24 lines
919 B
JavaScript
Raw Normal View History

2019-05-02 21:11:52 +02:00
module.exports = {
transform: {
2019-10-11 23:50:03 +02:00
'^.+\\.(tsx?|jsx?)$': 'ts-jest',
'^.+\\.jsx?$': '<rootDir>/jest/jest-preprocess.js'
2019-05-02 21:11:52 +02:00
},
2019-10-11 23:50:03 +02:00
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$',
2019-05-02 21:11:52 +02:00
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
2019-10-11 23:50:03 +02:00
'<rootDir>/jest/__mocks__/file-mock.ts',
'\\.svg': '<rootDir>/jest/__mocks__/svgr-mock.ts'
2019-05-02 21:11:52 +02:00
},
2019-10-11 23:50:03 +02:00
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
2019-05-02 21:11:52 +02:00
testPathIgnorePatterns: ['node_modules', '.cache', 'public', 'coverage'],
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
globals: {
__PATH_PREFIX__: ''
},
testURL: 'http://localhost',
setupFiles: ['<rootDir>/jest/loadershim.js'],
2019-10-11 23:50:03 +02:00
setupFilesAfterEnv: ['<rootDir>/jest/setup-test-env.ts'],
2019-10-02 13:35:50 +02:00
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/@types/**/*']
2019-05-02 21:11:52 +02:00
}