bigbuffet-rw/jest.config.cjs

51 lines
1.6 KiB
JavaScript
Raw Normal View History

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/',
2023-06-20 15:48:57 -07:00
'<rootDir>/app/soapbox/actions/',
],
'setupFiles': [
'raf/polyfill',
],
'setupFilesAfterEnv': [
'<rootDir>/app/soapbox/jest/test-setup.ts',
],
'collectCoverageFrom': [
2020-05-28 15:52:07 -07:00
'app/soapbox/**/*.js',
'app/soapbox/**/*.cjs',
'app/soapbox/**/*.mjs',
'app/soapbox/**/*.ts',
'app/soapbox/**/*.tsx',
2022-11-16 06:00:19 -08:00
'!app/soapbox/service-worker/entry.ts',
'!app/soapbox/jest/test-setup.ts',
2022-04-04 12:05:15 -07:00
'!app/soapbox/jest/test-helpers.ts',
],
2022-04-05 06:22:47 -07:00
'coverageDirectory': '<rootDir>/.coverage/',
2022-05-27 07:23:59 -07:00
'coverageReporters': ['html', 'text', 'text-summary', 'cobertura'],
'reporters': ['default', 'jest-junit'],
'moduleDirectories': [
'<rootDir>/node_modules',
'<rootDir>/app',
],
2022-04-04 12:58:23 -07:00
'testMatch': ['**/*/__tests__/**/?(*.|*-)+(test).(ts|js)?(x)'],
2021-07-10 01:10:55 -07:00
'testEnvironment': 'jsdom',
'transformIgnorePatterns': [
2022-04-06 09:13:21 -07: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
2023-02-12 18:23:29 -08:00
`/node_modules/(?!(react-sticky-box|blurhash|emoji-mart|.+\\.(${ASSET_EXTS})$))`,
// Ignore node_modules, except static assets
2022-07-09 12:04:01 -07:00
// `/node_modules/(?!.+\\.(${ASSET_EXTS})$)`,
],
2021-09-06 17:03:23 -07:00
'transform': {
'\\.[jt]sx?$': 'babel-jest',
[`\\.(${ASSET_EXTS})$`]: '<rootDir>/jest/assetTransformer.cjs',
2021-09-06 17:03:23 -07:00
},
};