2017-05-19 20:54:22 +03:00
|
|
|
module.exports = {
|
2017-06-05 20:01:15 +03:00
|
|
|
collectCoverageFrom: ['src/**/*.{js,jsx}'],
|
2017-05-19 20:54:22 +03:00
|
|
|
coveragePathIgnorePatterns: [
|
|
|
|
'<rootDir>/node_modules/',
|
2021-01-12 17:07:03 +03:00
|
|
|
'<rootDir>/src/amo/server/webpack-isomorphic-tools-config.js',
|
2017-06-05 20:01:15 +03:00
|
|
|
'<rootDir>/src/locale/',
|
2017-05-19 20:54:22 +03:00
|
|
|
],
|
2018-06-27 18:51:33 +03:00
|
|
|
moduleDirectories: ['src', 'node_modules'],
|
|
|
|
moduleFileExtensions: ['js', 'json', 'jsx'],
|
2017-05-19 20:54:22 +03:00
|
|
|
moduleNameMapper: {
|
2017-05-25 18:35:25 +03:00
|
|
|
// Alias tests for tests to be able to import helpers.
|
|
|
|
'^tests/(.*)$': '<rootDir>/tests/$1',
|
2021-04-20 00:56:58 +03:00
|
|
|
// Alias config for tests to be able to import config files.
|
|
|
|
'^config/(.*)$': '<rootDir>/config/$1',
|
2017-05-23 15:13:11 +03:00
|
|
|
// Replaces the following formats with an empty module.
|
2021-05-27 11:52:25 +03:00
|
|
|
'^.+\\.(scss|css|woff|woff2|mp4|webm)$': '<rootDir>/tests/emptyModule',
|
2018-10-18 19:43:48 +03:00
|
|
|
// Alias bin for bin scripts.
|
|
|
|
'^bin/(.*)$': '<rootDir>/bin/$1',
|
2017-05-19 20:54:22 +03:00
|
|
|
},
|
2018-08-23 22:08:05 +03:00
|
|
|
reporters: [
|
|
|
|
'<rootDir>/tests/jest-reporters/fingers-crossed.js',
|
|
|
|
'<rootDir>/tests/jest-reporters/summary.js',
|
2018-10-15 23:02:23 +03:00
|
|
|
'<rootDir>/tests/jest-reporters/flow-check.js',
|
2018-11-19 22:30:57 +03:00
|
|
|
'<rootDir>/tests/jest-reporters/eslint-check.js',
|
2018-08-23 22:08:05 +03:00
|
|
|
],
|
2019-01-29 17:57:00 +03:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
2022-02-25 08:37:44 +03:00
|
|
|
testEnvironment: 'jsdom',
|
2017-05-24 13:28:06 +03:00
|
|
|
testPathIgnorePatterns: [
|
|
|
|
'<rootDir>/node_modules/',
|
|
|
|
'<rootDir>/(assets|bin|config|coverage|dist|docs|flow|locale|src)/',
|
|
|
|
],
|
2018-06-27 18:51:33 +03:00
|
|
|
testMatch: ['**/[Tt]est(*).js?(x)', '**/__tests__/**/*.js?(x)'],
|
2017-11-30 17:49:41 +03:00
|
|
|
// This will initialize the jsdom document with a URL which is necessary
|
|
|
|
// for History push state to work.
|
|
|
|
// See https://github.com/ReactTraining/react-router/issues/5030
|
2022-07-29 19:52:12 +03:00
|
|
|
testEnvironmentOptions: { url: 'http://localhost/' },
|
2017-05-19 20:54:22 +03:00
|
|
|
transform: {
|
|
|
|
'^.+\\.js$': 'babel-jest',
|
2017-05-23 15:13:11 +03:00
|
|
|
// This transforms images to be a module that exports the filename.
|
2021-05-27 11:52:25 +03:00
|
|
|
// Tests can assert on the filename.
|
|
|
|
'^.+\\.(jpg|jpeg|gif|png|svg)$': '<rootDir>/tests/fileTransformer',
|
2017-05-19 20:54:22 +03:00
|
|
|
},
|
2018-06-27 18:51:33 +03:00
|
|
|
transformIgnorePatterns: ['<rootDir>/node_modules/'],
|
2018-06-22 21:35:13 +03:00
|
|
|
watchPlugins: [
|
|
|
|
'jest-watch-typeahead/filename',
|
|
|
|
'jest-watch-typeahead/testname',
|
|
|
|
],
|
2018-07-31 17:37:53 +03:00
|
|
|
watchPathIgnorePatterns: [
|
|
|
|
'<rootDir>/bin/server.js',
|
|
|
|
'<rootDir>/webpack-assets.json',
|
|
|
|
],
|
2017-05-24 13:28:06 +03:00
|
|
|
verbose: false,
|
2017-05-19 20:54:22 +03:00
|
|
|
};
|