Remove the deprecated plugins file

This commit is contained in:
Felipe Knorr Kuhn 2023-03-02 23:17:08 -08:00
parent 1ac8e5004f
commit 545b5be7d4
No known key found for this signature in database
GPG key ID: 79619B52BB097C1A
2 changed files with 12 additions and 19 deletions

View file

@ -1,4 +1,4 @@
import { defineConfig } from 'cypress'
import { defineConfig } from 'cypress';
export default defineConfig({
projectId: 'ry4br7',
@ -12,12 +12,18 @@ export default defineConfig({
},
chromeWebSecurity: false,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
setupNodeEvents(on: any, config: any) {
const fs = require('fs');
const CONFIG_FILE = 'mempool-frontend-config.json';
if (fs.existsSync(CONFIG_FILE)) {
let contents = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
config.env.BASE_MODULE = contents.BASE_MODULE ? contents.BASE_MODULE : 'mempool';
} else {
config.env.BASE_MODULE = 'mempool';
}
return config;
},
baseUrl: 'http://localhost:4200',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
});

View file

@ -1,13 +0,0 @@
const fs = require('fs');
const CONFIG_FILE = 'mempool-frontend-config.json';
module.exports = (on, config) => {
if (fs.existsSync(CONFIG_FILE)) {
let contents = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
config.env.BASE_MODULE = contents.BASE_MODULE ? contents.BASE_MODULE : 'mempool';
} else {
config.env.BASE_MODULE = 'mempool';
}
return config;
}