addons-frontend/jest.config.js

49 строки
1.8 KiB
JavaScript
Исходник Обычный вид История

2017-05-19 20:54:22 +03:00
module.exports = {
collectCoverageFrom: ['src/**/*.{js,jsx}'],
2017-05-19 20:54:22 +03:00
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/src/core/server/webpack-isomorphic-tools-config.js',
'<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: {
// Prevent un-transpiled react-photoswipe code being required.
'^photoswipe$': '<rootDir>/node_modules/photoswipe',
2017-05-25 18:35:25 +03:00
// Alias tests for tests to be able to import helpers.
'^tests/(.*)$': '<rootDir>/tests/$1',
// Replaces the following formats with an empty module.
2017-05-19 20:54:22 +03:00
'^.+\\.(scss|css|svg|woff|woff2|mp4|webm)$': '<rootDir>/tests/emptyModule',
},
2018-08-23 22:08:05 +03:00
reporters: [
'<rootDir>/tests/jest-reporters/fingers-crossed.js',
'<rootDir>/tests/jest-reporters/summary.js',
],
2017-05-19 20:54:22 +03:00
setupTestFrameworkScriptFile: '<rootDir>/tests/setup.js',
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)'],
// 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
testURL: 'http://localhost/',
2017-05-19 20:54:22 +03:00
transform: {
'^.+\\.js$': 'babel-jest',
// This transforms images to be a module that exports the filename.
// Tests can assert on the filenname.
2017-05-19 20:54:22 +03:00
'^.+\\.(jpg|jpeg|gif|png)$': '<rootDir>/tests/fileTransformer',
},
2018-06-27 18:51:33 +03:00
transformIgnorePatterns: ['<rootDir>/node_modules/'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
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
};