Skip to content

Commit 226698f

Browse files
committed
clean tests and add a test for new warning
1 parent ee42c73 commit 226698f

File tree

4 files changed

+11
-66
lines changed

4 files changed

+11
-66
lines changed

packages/config/__snapshots__/index.spec.ts.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ exports['config/src/index .getBreakingKeys returns list of breaking config keys
33
'experimentalSessionAndOrigin',
44
'experimentalSkipDomainInjection',
55
'videoUploadOnPasses',
6+
'experimentalStudio',
67
]
78

89
exports['config/src/index .getDefaultValues returns list of public config keys 1'] = {
@@ -32,7 +33,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
3233
'experimentalOriginDependencies': false,
3334
'experimentalSourceRewriting': false,
3435
'experimentalSingleTabRunMode': false,
35-
'experimentalStudio': false,
3636
'experimentalWebKitSupport': false,
3737
'fileServerFolder': '',
3838
'fixturesFolder': 'cypress/fixtures',
@@ -123,7 +123,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
123123
'experimentalOriginDependencies': false,
124124
'experimentalSourceRewriting': false,
125125
'experimentalSingleTabRunMode': false,
126-
'experimentalStudio': false,
127126
'experimentalWebKitSupport': false,
128127
'fileServerFolder': '',
129128
'fixturesFolder': 'cypress/fixtures',
@@ -210,7 +209,6 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key
210209
'experimentalOriginDependencies',
211210
'experimentalSourceRewriting',
212211
'experimentalSingleTabRunMode',
213-
'experimentalStudio',
214212
'experimentalWebKitSupport',
215213
'fileServerFolder',
216214
'fixturesFolder',

packages/config/test/project/utils.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,16 @@ describe('config/src/project/utils', () => {
978978
expect(warning).to.be.calledWith('EXPERIMENTAL_SESSION_AND_ORIGIN_REMOVED')
979979
})
980980

981+
it('warns if experimentalStudio is passed', async function () {
982+
const warning = sinon.spy(errors, 'warning')
983+
984+
await this.defaults('experimentalStudio', true, {
985+
experimentalStudio: true,
986+
})
987+
988+
expect(warning).to.be.calledWith('EXPERIMENTAL_STUDIO_REMOVED')
989+
})
990+
981991
describe('.resolved', () => {
982992
it('sets reporter and port to cli', () => {
983993
const obj = {
@@ -1015,7 +1025,6 @@ describe('config/src/project/utils', () => {
10151025
experimentalOriginDependencies: { value: false, from: 'default' },
10161026
experimentalRunAllSpecs: { value: false, from: 'default' },
10171027
experimentalSingleTabRunMode: { value: false, from: 'default' },
1018-
experimentalStudio: { value: false, from: 'default' },
10191028
experimentalSourceRewriting: { value: false, from: 'default' },
10201029
experimentalWebKitSupport: { value: false, from: 'default' },
10211030
fileServerFolder: { value: '', from: 'default' },
@@ -1134,7 +1143,6 @@ describe('config/src/project/utils', () => {
11341143
experimentalOriginDependencies: { value: false, from: 'default' },
11351144
experimentalRunAllSpecs: { value: false, from: 'default' },
11361145
experimentalSingleTabRunMode: { value: false, from: 'default' },
1137-
experimentalStudio: { value: false, from: 'default' },
11381146
experimentalSourceRewriting: { value: false, from: 'default' },
11391147
experimentalWebKitSupport: { value: false, from: 'default' },
11401148
fileServerFolder: { value: '', from: 'default' },

packages/launchpad/cypress/e2e/config-warning.cy.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -90,40 +90,6 @@ describe('experimentalSingleTabRunMode', () => {
9090
})
9191
})
9292

93-
describe('experimentalStudio', () => {
94-
it('is not a valid config for component testing', () => {
95-
cy.scaffoldProject('experimentalSingleTabRunMode')
96-
cy.openProject('experimentalSingleTabRunMode', ['--config-file', 'cypress-invalid-studio-experiment.config.js'])
97-
98-
cy.visitLaunchpad()
99-
cy.get('[data-cy-testingtype="component"]').click()
100-
cy.findByTestId('error-header')
101-
cy.contains('The experimentalStudio experiment is currently only supported for End to End Testing.')
102-
})
103-
104-
it('is a valid config for e2e testing', { defaultCommandTimeout: THIRTY_SECONDS }, () => {
105-
cy.scaffoldProject('e2e')
106-
cy.openProject('e2e')
107-
cy.withCtx(async (ctx) => {
108-
await ctx.actions.file.writeFileInProject('cypress.config.js', `
109-
const { defineConfig } = require('cypress')
110-
111-
module.exports = defineConfig({
112-
experimentalStudio: true,
113-
e2e: {
114-
experimentalStudio: true
115-
},
116-
})
117-
`)
118-
})
119-
120-
cy.visitLaunchpad()
121-
cy.get('[data-cy-testingtype="e2e"]').click()
122-
cy.findByTestId('launchpad-Choose a browser')
123-
cy.get('h1').contains('Choose a browser')
124-
})
125-
})
126-
12793
describe('experimentalRunAllSpecs', () => {
12894
it('is a valid config for e2e testing', { defaultCommandTimeout: THIRTY_SECONDS }, () => {
12995
cy.scaffoldProject('run-all-specs')

packages/server/test/unit/project_spec.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -574,36 +574,9 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
574574
})
575575

576576
describe('studio initialization', function () {
577-
it('does not create studio lifecycle manager when experimental flag is disabled', async function () {
578-
const cfg = {
579-
isTextTerminal: false,
580-
resolved: {
581-
experimentalStudio: {
582-
value: false,
583-
},
584-
},
585-
projectId: 'test-project',
586-
port: 8080,
587-
}
588-
589-
sinon.stub(this.project, 'initializeConfig').resolves(cfg)
590-
sinon.stub(this.project, 'saveState').resolves()
591-
592-
sinon.stub(process, 'chdir')
593-
594-
await this.project.open()
595-
596-
expect(this.project.ctx.coreData.studioLifecycleManager).to.be.undefined
597-
})
598-
599577
it('does not create studio lifecycle manager when in text terminal mode', async function () {
600578
const cfg = {
601579
isTextTerminal: true,
602-
resolved: {
603-
experimentalStudio: {
604-
value: true,
605-
},
606-
},
607580
projectId: 'test-project',
608581
port: 8080,
609582
}

0 commit comments

Comments
 (0)