Skip to content

Commit

Permalink
chore(PPDSC-1581): tidy plugins structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuartf committed Jan 9, 2023
1 parent a0fbd60 commit a4627db
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
5 changes: 0 additions & 5 deletions cypress.components.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import {defineConfig} from 'cypress';

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require
return require(// eslint-disable-next-line import/extensions
'./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:8080',
specPattern: 'cypress/components/**/*.cy.{js,jsx,ts,tsx}',
},
Expand Down
12 changes: 8 additions & 4 deletions cypress.docs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import {defineConfig} from 'cypress';

const {readAllFilesInDir} = require('./cypress/plugins/files');

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require
return require(// eslint-disable-next-line import/extensions
'./cypress/plugins/index.js')(on, config);
setupNodeEvents(on) {
on('task', {
readAllFilesInDir(dir) {
return readAllFilesInDir(dir);
},
});
},
baseUrl: 'http://localhost:8081',
specPattern: 'cypress/site/functional/**/*.cy.{js,jsx,ts,tsx}',
Expand Down
5 changes: 0 additions & 5 deletions cypress.docs.percy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import {defineConfig} from 'cypress';

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require
return require(// eslint-disable-next-line import/extensions
'./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:8081',
specPattern: 'cypress/site/percy/**/*.cy.{js,jsx,ts,tsx}',
},
Expand Down
5 changes: 0 additions & 5 deletions cypress.docs.percy.skip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import {defineConfig} from 'cypress';

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require
return require(// eslint-disable-next-line import/extensions
'./cypress/plugins/index.js')(on, config);
},
baseUrl: null,
specPattern: 'cypress/site/percy-skip/**/*.cy.{js,jsx,ts,tsx}',
},
Expand Down
8 changes: 1 addition & 7 deletions cypress/plugins/index.js → cypress/plugins/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,4 @@ async function readAllFilesInDir(dir) {
return results;
}

module.exports = on => {
on('task', {
readAllFilesInDir(dir) {
return readAllFilesInDir(dir);
},
});
};
module.exports = {readAllFilesInDir};

0 comments on commit a4627db

Please sign in to comment.