From 9f8eb74d456a14e1e479b7f161c3b0ac33f083d6 Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Wed, 6 Mar 2024 16:26:50 +0100 Subject: [PATCH] refactor(cypress): rename config files and imports to use cjs so cypress runs locally --- cypress.config.js => cypress.config.cjs | 8 ++++---- .../{CDPDataCollector.js => CDPDataCollector.cjs} | 0 .../plugins/benchmark/{formatting.js => formatting.cjs} | 0 e2e/cypress/plugins/benchmark/{index.js => index.cjs} | 4 ++-- e2e/cypress/plugins/{extendConfig.js => extendConfig.cjs} | 0 e2e/cypress/plugins/{index.js => index.cjs} | 8 ++++---- .../plugins/{readProvisions.js => readProvisions.cjs} | 0 e2e/cypress/plugins/{smtpTester.js => smtpTester.cjs} | 0 ...pescriptPreprocessor.js => typescriptPreprocessor.cjs} | 0 e2e/cypress/support/e2e.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) rename cypress.config.js => cypress.config.cjs (96%) rename e2e/cypress/plugins/benchmark/{CDPDataCollector.js => CDPDataCollector.cjs} (100%) rename e2e/cypress/plugins/benchmark/{formatting.js => formatting.cjs} (100%) rename e2e/cypress/plugins/benchmark/{index.js => index.cjs} (95%) rename e2e/cypress/plugins/{extendConfig.js => extendConfig.cjs} (100%) rename e2e/cypress/plugins/{index.js => index.cjs} (93%) rename e2e/cypress/plugins/{readProvisions.js => readProvisions.cjs} (100%) rename e2e/cypress/plugins/{smtpTester.js => smtpTester.cjs} (100%) rename e2e/cypress/plugins/{typescriptPreprocessor.js => typescriptPreprocessor.cjs} (100%) diff --git a/cypress.config.js b/cypress.config.cjs similarity index 96% rename from cypress.config.js rename to cypress.config.cjs index a03692e2ac0..da3d1a438ef 100644 --- a/cypress.config.js +++ b/cypress.config.cjs @@ -2,10 +2,10 @@ const { defineConfig } = require('cypress'); const fs = require('fs'); const path = require('path'); -const benchmarkPlugin = require('./e2e/cypress/plugins/benchmark/index'); -const readProvisions = require('./e2e/cypress/plugins/readProvisions'); -const smtpTester = require('./e2e/cypress/plugins/smtpTester'); -const typescriptPreprocessor = require('./e2e/cypress/plugins/typescriptPreprocessor'); +const benchmarkPlugin = require('./e2e/cypress/plugins/benchmark/index.cjs'); +const readProvisions = require('./e2e/cypress/plugins/readProvisions.cjs'); +const smtpTester = require('./e2e/cypress/plugins/smtpTester.cjs'); +const typescriptPreprocessor = require('./e2e/cypress/plugins/typescriptPreprocessor.cjs'); module.exports = defineConfig({ projectId: 'zb7k1c', diff --git a/e2e/cypress/plugins/benchmark/CDPDataCollector.js b/e2e/cypress/plugins/benchmark/CDPDataCollector.cjs similarity index 100% rename from e2e/cypress/plugins/benchmark/CDPDataCollector.js rename to e2e/cypress/plugins/benchmark/CDPDataCollector.cjs diff --git a/e2e/cypress/plugins/benchmark/formatting.js b/e2e/cypress/plugins/benchmark/formatting.cjs similarity index 100% rename from e2e/cypress/plugins/benchmark/formatting.js rename to e2e/cypress/plugins/benchmark/formatting.cjs diff --git a/e2e/cypress/plugins/benchmark/index.js b/e2e/cypress/plugins/benchmark/index.cjs similarity index 95% rename from e2e/cypress/plugins/benchmark/index.js rename to e2e/cypress/plugins/benchmark/index.cjs index 922a6e5c026..1c5f53ae32e 100644 --- a/e2e/cypress/plugins/benchmark/index.js +++ b/e2e/cypress/plugins/benchmark/index.cjs @@ -1,8 +1,8 @@ const fs = require('fs'); const { fromPairs } = require('lodash'); -const { CDPDataCollector } = require('./CDPDataCollector'); -const { formatResults } = require('./formatting'); +const { CDPDataCollector } = require('./CDPDataCollector.cjs'); +const { formatResults } = require('./formatting.cjs'); const remoteDebuggingPortOptionPrefix = '--remote-debugging-port='; diff --git a/e2e/cypress/plugins/extendConfig.js b/e2e/cypress/plugins/extendConfig.cjs similarity index 100% rename from e2e/cypress/plugins/extendConfig.js rename to e2e/cypress/plugins/extendConfig.cjs diff --git a/e2e/cypress/plugins/index.js b/e2e/cypress/plugins/index.cjs similarity index 93% rename from e2e/cypress/plugins/index.js rename to e2e/cypress/plugins/index.cjs index 2f464a2770a..58971f92586 100644 --- a/e2e/cypress/plugins/index.js +++ b/e2e/cypress/plugins/index.cjs @@ -2,10 +2,10 @@ const fs = require('fs'); const path = require('path'); const benchmarkPlugin = require('./benchmark'); -const extendConfig = require('./extendConfig'); -const readProvisions = require('./readProvisions'); -const smtpTester = require('./smtpTester'); -const typescriptPreprocessor = require('./typescriptPreprocessor'); +const extendConfig = require('./extendConfig.cjs'); +const readProvisions = require('./readProvisions.cjs'); +const smtpTester = require('./smtpTester.cjs'); +const typescriptPreprocessor = require('./typescriptPreprocessor.cjs'); module.exports = (on, config) => { if (config.env['BENCHMARK_PLUGIN_ENABLED'] === true) { diff --git a/e2e/cypress/plugins/readProvisions.js b/e2e/cypress/plugins/readProvisions.cjs similarity index 100% rename from e2e/cypress/plugins/readProvisions.js rename to e2e/cypress/plugins/readProvisions.cjs diff --git a/e2e/cypress/plugins/smtpTester.js b/e2e/cypress/plugins/smtpTester.cjs similarity index 100% rename from e2e/cypress/plugins/smtpTester.js rename to e2e/cypress/plugins/smtpTester.cjs diff --git a/e2e/cypress/plugins/typescriptPreprocessor.js b/e2e/cypress/plugins/typescriptPreprocessor.cjs similarity index 100% rename from e2e/cypress/plugins/typescriptPreprocessor.js rename to e2e/cypress/plugins/typescriptPreprocessor.cjs diff --git a/e2e/cypress/support/e2e.js b/e2e/cypress/support/e2e.js index ddd50a58844..c5e4a9aa608 100644 --- a/e2e/cypress/support/e2e.js +++ b/e2e/cypress/support/e2e.js @@ -1,4 +1,4 @@ -require('./commands'); +import './commands.js'; Cypress.Screenshot.defaults({ screenshotOnRunFailure: false,