2017-05-19 20:54:22 +03:00
|
|
|
module.exports = {
|
|
|
|
coveragePathIgnorePatterns: [
|
|
|
|
'<rootDir>/node_modules/',
|
|
|
|
'<rootDir>/src/core/server/webpack-isomorphic-tools-config.js',
|
|
|
|
'<rootDir>/tests/',
|
|
|
|
'<rootDir>/config/',
|
|
|
|
],
|
2017-05-23 15:13:11 +03:00
|
|
|
moduleDirectories: [
|
|
|
|
'src',
|
|
|
|
'node_modules',
|
|
|
|
'<rootDir>',
|
|
|
|
],
|
2017-05-19 20:54:22 +03:00
|
|
|
moduleFileExtensions: [
|
|
|
|
'js',
|
|
|
|
'json',
|
|
|
|
'jsx',
|
|
|
|
],
|
|
|
|
moduleNameMapper: {
|
|
|
|
// Prevent un-transpiled react-photoswipe code being required.
|
|
|
|
'^photoswipe$': '<rootDir>/node_modules/photoswipe',
|
2017-05-23 15:13:11 +03:00
|
|
|
// Use the client-side logger by default for tests.
|
2017-05-19 20:54:22 +03:00
|
|
|
'^core/logger$': '<rootDir>/src/core/client/logger',
|
|
|
|
'^core/window$': '<rootDir>/src/core/browserWindow',
|
2017-05-23 15:13:11 +03:00
|
|
|
// 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',
|
|
|
|
},
|
|
|
|
setupTestFrameworkScriptFile: '<rootDir>/tests/setup.js',
|
|
|
|
testPathIgnorePatterns: ['/node_modules', '<rootDir>/config'],
|
|
|
|
testMatch: [
|
|
|
|
'**/__tests__/**/*.js?(x)',
|
|
|
|
'**/[Tt]est(*).js?(x)',
|
|
|
|
],
|
|
|
|
transform: {
|
|
|
|
'^.+\\.js$': 'babel-jest',
|
2017-05-23 15:13:11 +03:00
|
|
|
// 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',
|
|
|
|
},
|
|
|
|
transformIgnorePatterns: [
|
|
|
|
'<rootDir>/node_modules/',
|
|
|
|
],
|
|
|
|
verbose: true,
|
|
|
|
};
|