soapbox/jest.config.js

49 wiersze
1.5 KiB
JavaScript
Czysty Zwykły widok Historia

const ASSET_EXTS = 'css|styl|less|sass|scss|png|jpg|svg|ogg|oga|mp3|ttf|woff|woff2';
module.exports = {
'testPathIgnorePatterns': [
'<rootDir>/node_modules/',
'<rootDir>/vendor/',
'<rootDir>/config/',
'<rootDir>/log/',
'<rootDir>/static/',
'<rootDir>/tmp/',
'<rootDir>/webpack/',
],
'setupFiles': [
'raf/polyfill',
],
'setupFilesAfterEnv': [
'<rootDir>/app/soapbox/jest/test-setup.ts',
],
'collectCoverageFrom': [
2020-05-28 22:52:07 +00:00
'app/soapbox/**/*.js',
'app/soapbox/**/*.ts',
'app/soapbox/**/*.tsx',
2020-05-28 22:52:07 +00:00
'!app/soapbox/features/emoji/emoji_compressed.js',
'!app/soapbox/locales/locale-data/*.js',
'!app/soapbox/service_worker/entry.ts',
'!app/soapbox/jest/test-setup.ts',
2022-04-04 19:05:15 +00:00
'!app/soapbox/jest/test-helpers.ts',
],
2022-04-05 13:22:47 +00:00
'coverageDirectory': '<rootDir>/.coverage/',
2022-05-27 14:23:59 +00:00
'coverageReporters': ['html', 'text', 'text-summary', 'cobertura'],
'moduleDirectories': [
'<rootDir>/node_modules',
'<rootDir>/app',
],
2022-04-04 19:58:23 +00:00
'testMatch': ['**/*/__tests__/**/?(*.|*-)+(test).(ts|js)?(x)'],
2021-07-10 08:10:55 +00:00
'testEnvironment': 'jsdom',
'transformIgnorePatterns': [
2022-04-06 16:13:21 +00:00
// FIXME: react-sticky-box doesn't provide a CJS build, so transform it for now
// https://github.com/codecks-io/react-sticky-box/issues/79
`/node_modules/(?!(react-sticky-box|.+\\.(${ASSET_EXTS})))`,
// Ignore node_modules, except static assets
2022-04-06 16:13:21 +00:00
// `/node_modules/(?!.+\\.(${ASSET_EXTS}))`,
],
2021-09-07 00:03:23 +00:00
'transform': {
'\\.[jt]sx?$': 'babel-jest',
[`.+\\.(${ASSET_EXTS})$`]: '<rootDir>/jest/assetTransformer.js',
2021-09-07 00:03:23 +00:00
},
};