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-04-28 20:14:11 +00:00
|
|
|
'<rootDir>/node_modules/woocommerce/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: [
|
|
|
|
'<rootDir>/config/jest.setup.js',
|
|
|
|
'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)/)' ],
|
|
|
|
};
|