2021-08-23 17:39:03 +00:00
|
|
|
require('dotenv').config();
|
|
|
|
const { BASE_URL, VERBOSE, USE_INDEX_PERMALINKS } = process.env;
|
2021-08-24 01:25:07 +00:00
|
|
|
const verboseOutput = VERBOSE === 'true';
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
// Update the API path if the `USE_INDEX_PERMALINKS` flag is set
|
2021-08-24 01:25:07 +00:00
|
|
|
const useIndexPermalinks = USE_INDEX_PERMALINKS === 'true';
|
2021-09-07 22:20:44 +00:00
|
|
|
let apiPath = `${BASE_URL}/?rest_route=/wc/v3/`;
|
|
|
|
if ( useIndexPermalinks ) {
|
|
|
|
apiPath = `${BASE_URL}/wp-json/wc/v3/`;
|
2021-08-23 17:39:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
// Use the `jest-runner-groups` package.
|
2021-08-24 01:25:07 +00:00
|
|
|
runner: 'groups',
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
// A set of global variables that need to be available in all test environments
|
|
|
|
globals: {
|
2021-08-24 01:25:07 +00:00
|
|
|
API_PATH: apiPath,
|
2021-08-23 17:39:03 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Indicates whether each individual test should be reported during the run
|
|
|
|
verbose: verboseOutput,
|
|
|
|
};
|