1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-25 03:14:01 +01:00
blog/.jest/jest.config.js

57 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-04-20 22:03:12 +02:00
const esModules = [
'unified',
'vfile',
'vfile-.+',
'unist-.+',
'bail',
'is-plain-obj',
'trough',
'mdast-util-.+',
'micromark',
'micromark-.+',
'parse-entities',
'character-entities',
'property-information',
'comma-separated-tokens',
'hast-.+',
'remark-.+',
'rehype-.+',
'space-separated-tokens',
2022-09-10 12:05:52 +02:00
'trim-lines',
2022-04-20 22:03:12 +02:00
'decode-named-character-reference',
'ccount',
'escape-string-regexp',
'markdown-table',
'web-namespaces',
2022-11-19 22:01:53 +01:00
'@rainbow-me/rainbowkit',
'wagmi',
2022-12-25 16:16:25 +01:00
'@wagmi/chains',
'@wagmi/core',
'@wagmi/connectors'
2022-04-20 22:03:12 +02:00
].join('|')
2019-05-02 21:11:52 +02:00
module.exports = {
2020-07-02 20:32:16 +02:00
rootDir: '../',
transform: {
2022-05-12 01:00:19 +02:00
'^.+\\.[jt]sx?$': ['babel-jest', { configFile: './.jest/babel.config.js' }]
2020-07-02 20:32:16 +02:00
},
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)$':
2022-05-16 20:56:39 +02:00
'<rootDir>/.jest/__mocks__/file.js',
'\\.svg': '<rootDir>/.jest/__mocks__/svgr.js',
'^@reach/router(.*)': '<rootDir>/node_modules/@gatsbyjs/reach-router$1'
2019-05-02 21:11:52 +02:00
},
testPathIgnorePatterns: ['node_modules', '.cache', 'public', 'coverage'],
2022-07-07 01:30:21 +02:00
transformIgnorePatterns: [
`node_modules/(?!(gatsby|gatsby-link|gatsby-script|${esModules})/)`
],
2019-05-02 21:11:52 +02:00
globals: {
__PATH_PREFIX__: ''
},
2022-05-12 01:00:19 +02:00
setupFiles: ['<rootDir>/.jest/loadershim.js'],
setupFilesAfterEnv: ['<rootDir>/.jest/setup-test-env.ts'],
2021-08-28 13:22:25 +02:00
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/@types/**/*'],
testEnvironment: 'jsdom'
2019-05-02 21:11:52 +02:00
}