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