2020-04-02 13:41:06 +00:00
|
|
|
module.exports = {
|
|
|
|
// Automatically clear mock calls and instances between every test
|
|
|
|
clearMocks: true,
|
|
|
|
|
|
|
|
// An array of file extensions your modules use
|
|
|
|
moduleFileExtensions: [ 'js' ],
|
|
|
|
|
|
|
|
moduleNameMapper: {
|
|
|
|
'@woocommerce/e2e-tests/(.*)':
|
2020-05-11 18:45:32 +00:00
|
|
|
'<rootDir>/tests/e2e/$1',
|
2020-04-02 13:41:06 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
preset: 'jest-puppeteer',
|
|
|
|
|
|
|
|
setupFiles: [ '<rootDir>/config/env.setup.js' ],
|
|
|
|
// A list of paths to modules that run some code to configure or set up the testing framework
|
|
|
|
// before each test
|
|
|
|
setupFilesAfterEnv: [
|
2020-05-11 18:45:32 +00:00
|
|
|
'<rootDir>/build/setup/jest.setup.js',
|
2020-04-02 13:41:06 +00:00
|
|
|
'expect-puppeteer',
|
|
|
|
],
|
|
|
|
|
|
|
|
// The glob patterns Jest uses to detect test files
|
|
|
|
testMatch: [ '**/*.(test|spec).js' ],
|
|
|
|
// Sort test path alphabetically. This is needed so that `activate-and-setup` tests run first
|
|
|
|
testSequencer: '<rootDir>/config/jest-custom-sequencer.js',
|
2020-05-05 16:56:00 +00:00
|
|
|
// Set the test timeout in milliseconds.
|
|
|
|
testTimeout: parseInt( global.process.env.jest_test_timeout ),
|
2020-04-02 13:41:06 +00:00
|
|
|
|
|
|
|
transformIgnorePatterns: [ 'node_modules/(?!(woocommerce)/)' ],
|
|
|
|
};
|