2023-02-16 09:24:35 +09:00
|
|
|
/** @type {import('jest').Config} */
|
|
|
|
const config = {
|
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
testPathIgnorePatterns: [
|
2022-05-04 14:06:49 +09:00
|
|
|
'<rootDir>/node_modules/',
|
|
|
|
'<rootDir>/vendor/',
|
|
|
|
'<rootDir>/config/',
|
|
|
|
'<rootDir>/log/',
|
|
|
|
'<rootDir>/public/',
|
|
|
|
'<rootDir>/tmp/',
|
|
|
|
],
|
2023-02-16 09:24:35 +09:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/app/javascript/mastodon/test_setup.js'],
|
|
|
|
collectCoverageFrom: [
|
2023-04-17 17:12:04 +09:00
|
|
|
'app/javascript/mastodon/**/*.{js,jsx,ts,tsx}',
|
2022-05-04 14:06:49 +09:00
|
|
|
'!app/javascript/mastodon/features/emoji/emoji_compressed.js',
|
|
|
|
'!app/javascript/mastodon/service_worker/entry.js',
|
|
|
|
'!app/javascript/mastodon/test_setup.js',
|
|
|
|
],
|
2023-11-08 19:57:21 +09:00
|
|
|
// Those packages are ESM, so we need them to be processed by Babel
|
|
|
|
transformIgnorePatterns: ['/node_modules/(?!(redent|strip-indent)/)'],
|
2023-02-16 09:24:35 +09:00
|
|
|
coverageDirectory: '<rootDir>/coverage',
|
2023-11-13 21:19:41 +09:00
|
|
|
moduleDirectories: ['node_modules', '<rootDir>/app/javascript'],
|
2023-10-25 02:45:08 +09:00
|
|
|
moduleNameMapper: {
|
2024-01-12 19:31:24 +09:00
|
|
|
'\\.svg\\?react$': '<rootDir>/app/javascript/__mocks__/svg.js',
|
2023-10-25 02:45:08 +09:00
|
|
|
},
|
2022-05-04 14:06:49 +09:00
|
|
|
};
|
2023-02-16 09:24:35 +09:00
|
|
|
|
|
|
|
module.exports = config;
|