2021-07-14 20:38:57 +00:00
|
|
|
/**
|
|
|
|
* External packages
|
|
|
|
*/
|
|
|
|
const path = require( 'path' );
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
moduleNameMapper: {
|
|
|
|
tinymce: path.resolve( __dirname, 'build/mocks/tinymce' ),
|
2022-01-06 12:53:30 +00:00
|
|
|
'@woocommerce/settings': path.resolve(
|
|
|
|
__dirname,
|
|
|
|
'build/mocks/woocommerce-settings'
|
|
|
|
),
|
2021-07-14 20:38:57 +00:00
|
|
|
'~/(.*)': path.resolve( __dirname, '../../client/$1' ),
|
|
|
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(
|
|
|
|
__dirname,
|
|
|
|
'build/mocks/static'
|
|
|
|
),
|
|
|
|
'\\.(scss|css)$': path.resolve(
|
|
|
|
__dirname,
|
|
|
|
'build/mocks/style-mock.js'
|
|
|
|
),
|
|
|
|
},
|
|
|
|
restoreMocks: true,
|
|
|
|
setupFiles: [
|
|
|
|
path.resolve( __dirname, 'build/setup-window-globals.js' ),
|
|
|
|
path.resolve( __dirname, 'build/setup-globals.js' ),
|
|
|
|
],
|
|
|
|
setupFilesAfterEnv: [
|
|
|
|
path.resolve( __dirname, 'build/setup-react-testing-library.js' ),
|
|
|
|
],
|
|
|
|
testMatch: [
|
|
|
|
'**/__tests__/**/*.[jt]s?(x)',
|
|
|
|
'**/test/*.[jt]s?(x)',
|
|
|
|
'**/?(*.)test.[jt]s?(x)',
|
|
|
|
],
|
|
|
|
testPathIgnorePatterns: [
|
|
|
|
'/node_modules/',
|
|
|
|
'<rootDir>/.*/build/',
|
|
|
|
'<rootDir>/.*/build-module/',
|
|
|
|
'<rootDir>/tests/e2e/',
|
|
|
|
],
|
|
|
|
transformIgnorePatterns: [ '/node_modules', '/build/' ],
|
|
|
|
transform: {
|
|
|
|
'^.+\\.[jt]sx?$': 'ts-jest',
|
|
|
|
},
|
2021-07-29 01:30:22 +00:00
|
|
|
testEnvironment: 'jest-environment-jsdom',
|
2021-07-14 20:38:57 +00:00
|
|
|
timers: 'modern',
|
|
|
|
verbose: true,
|
|
|
|
};
|