From 20cd105252f5ce6a91d12ea8a41cd362a7de57ec Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Fri, 10 Mar 2023 00:20:08 +0000 Subject: [PATCH] chore: rewrite flaky server integration test (#26070) --- .../server/test/integration/cypress_spec.js | 20 ++----------------- .../ids/cypress.dot-reporter.config.js | 4 ++++ 2 files changed, 6 insertions(+), 18 deletions(-) create mode 100644 system-tests/projects/ids/cypress.dot-reporter.config.js diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 581c912b51..aa33184b1b 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -596,24 +596,8 @@ describe('lib/cypress', () => { it('can change the reporter with cypress.config.js', async function () { sinon.spy(Reporter, 'create') - await ctx.actions.project.setCurrentProjectAndTestingTypeForTestSetup(this.idsPath) - - setCtx(makeDataContext({})) - - return ctx.lifecycleManager.getFullInitialConfig() - .then((cfg) => { - this.cfg = cfg - - return settings.read(this.idsPath) - }).then((json) => { - json.reporter = 'dot' - - return settings.writeForTesting(this.idsPath, json) - }).then(async () => { - await clearCtx() - - return cypress.start([`--run-project=${this.idsPath}`]) - }).then(() => { + return cypress.start([`--run-project=${this.idsPath}`, `--config-file=${this.idsPath}/cypress.dot-reporter.config.js`]) + .then(() => { expect(Reporter.create).to.be.calledWith('dot') this.expectExitWith(0) }) diff --git a/system-tests/projects/ids/cypress.dot-reporter.config.js b/system-tests/projects/ids/cypress.dot-reporter.config.js new file mode 100644 index 0000000000..055ab53397 --- /dev/null +++ b/system-tests/projects/ids/cypress.dot-reporter.config.js @@ -0,0 +1,4 @@ +module.exports = { + e2e: {}, + reporter: 'dot', +}