Skip to content

Commit

Permalink
convert base config to a function instead of const
Browse files Browse the repository at this point in the history
  • Loading branch information
gergoabraham committed Sep 19, 2023
1 parent 7ec96a3 commit 75cde75
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
*/

import { defineCypressConfig } from '@kbn/cypress-config';
import { CY_BASE_CONFIG } from './cypress_base.config';
import { getCypressBaseConfig } from './cypress_base.config';

import { dataLoaders } from './support/data_loaders';

export default defineCypressConfig({
...CY_BASE_CONFIG,
...getCypressBaseConfig(),

env: {
...CY_BASE_CONFIG.env,
...getCypressBaseConfig().env,

grepTags: '@ess',
},

e2e: {
...CY_BASE_CONFIG.e2e,
...getCypressBaseConfig().e2e,

specPattern: 'public/management/cypress/e2e/mocked_data/',
setupNodeEvents: (on, config) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

export const CY_BASE_CONFIG = {
export const getCypressBaseConfig = () => ({
reporter: '../../../../node_modules/cypress-multi-reporters',
reporterOptions: {
configFile: './public/management/reporter_config.json',
Expand Down Expand Up @@ -51,4 +51,4 @@ export const CY_BASE_CONFIG = {
supportFile: 'public/management/cypress/support/e2e.ts',
experimentalRunAllSpecs: true,
},
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
*/

import { defineCypressConfig } from '@kbn/cypress-config';
import { CY_BASE_CONFIG } from './cypress_base.config';
import { getCypressBaseConfig } from './cypress_base.config';

import { dataLoaders, dataLoadersForRealEndpoints } from './support/data_loaders';

import { responseActionTasks } from './support/response_actions';

// eslint-disable-next-line import/no-default-export
export default defineCypressConfig({
...CY_BASE_CONFIG,
...getCypressBaseConfig(),

env: {
...CY_BASE_CONFIG.env,
...getCypressBaseConfig().env,

'cypress-react-selector': {
root: '#security-solution-app',
Expand All @@ -27,7 +27,7 @@ export default defineCypressConfig({
},

e2e: {
...CY_BASE_CONFIG.e2e,
...getCypressBaseConfig().e2e,

experimentalMemoryManagement: true,
experimentalInteractiveRunEvents: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
*/

import { defineCypressConfig } from '@kbn/cypress-config';
import { CY_BASE_CONFIG } from './cypress_base.config';
import { getCypressBaseConfig } from './cypress_base.config';
import { dataLoaders } from './support/data_loaders';
import { responseActionTasks } from './support/response_actions';

// eslint-disable-next-line import/no-default-export
export default defineCypressConfig({
...CY_BASE_CONFIG,
...getCypressBaseConfig(),

env: {
...CY_BASE_CONFIG.env,
...getCypressBaseConfig().env,

IS_SERVERLESS: true,
grepTags: '@serverless --@brokenInServerless',
Expand All @@ -26,6 +26,8 @@ export default defineCypressConfig({
},

e2e: {
...getCypressBaseConfig().e2e,

experimentalMemoryManagement: true,
experimentalInteractiveRunEvents: true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
*/

import { defineCypressConfig } from '@kbn/cypress-config';
import { CY_BASE_CONFIG } from './cypress_base.config';
import { getCypressBaseConfig } from './cypress_base.config';
import { dataLoaders } from './support/data_loaders';

// eslint-disable-next-line import/no-default-export
export default defineCypressConfig({
...CY_BASE_CONFIG,
...getCypressBaseConfig(),

env: {
...CY_BASE_CONFIG.env,
...getCypressBaseConfig().env,

IS_SERVERLESS: true,

grepTags: '@serverless --@brokenInServerless',
},

e2e: {
...CY_BASE_CONFIG.e2e,
...getCypressBaseConfig().e2e,

specPattern: 'public/management/cypress/e2e/mocked_data/',

Expand Down

0 comments on commit 75cde75

Please sign in to comment.