Skip to content

Commit

Permalink
add warning if user uses experimentalRunEvents flag
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Mar 1, 2021
1 parent d2cf68c commit 9706649
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/server/lib/config_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,17 @@ export const breakingOptions = [
name: 'experimentalGetCookiesSameSite',
errorKey: 'EXPERIMENTAL_SAMESITE_REMOVED',
isWarning: true,
}, {
name: 'experimentalShadowDomSupport',
errorKey: 'EXPERIMENTAL_SHADOW_DOM_REMOVED',
isWarning: true,
}, {
name: 'experimentalNetworkStubbing',
errorKey: 'EXPERIMENTAL_NETWORK_STUBBING_REMOVED',
isWarning: true,
}, {
name: 'experimentalRunEvents',
errorKey: 'EXPERIMENTAL_RUN_EVENTS_REMOVED',
isWarning: true,
}, {
name: 'experimentalShadowDomSupport',
errorKey: 'EXPERIMENTAL_SHADOW_DOM_REMOVED',
isWarning: true,
},
]
5 changes: 5 additions & 0 deletions packages/server/lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,11 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) {
The \`experimentalNetworkStubbing\` configuration option was removed in Cypress version \`6.0.0\`.
It is no longer necessary for using \`cy.intercept()\` (formerly \`cy.route2()\`).
You can safely remove this option from your config.`
case 'EXPERIMENTAL_RUN_EVENTS_REMOVED':
return stripIndent`\
The \`experimentalRunEvents\` configuration option was removed in Cypress version \`6.7.0\`. It is no longer necessary when listening to run events in the plugins file.
You can safely remove this option from your config.`
case 'INCOMPATIBLE_PLUGIN_RETRIES':
return stripIndent`\
Expand Down
10 changes: 10 additions & 0 deletions packages/server/test/unit/config_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,16 @@ describe('lib/config', () => {
expect(warning).to.be.calledWith('EXPERIMENTAL_SHADOW_DOM_REMOVED')
})

it('warns if experimentalRunEvents is passed', async function () {
const warning = sinon.spy(errors, 'warning')

await this.defaults('experimentalRunEvents', true, {
experimentalRunEvents: true,
})

expect(warning).to.be.calledWith('EXPERIMENTAL_RUN_EVENTS_REMOVED')
})

// @see https://github.com/cypress-io/cypress/pull/9185
it('warns if experimentalNetworkStubbing is passed', async function () {
const warning = sinon.spy(errors, 'warning')
Expand Down

0 comments on commit 9706649

Please sign in to comment.