-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: test config overrides leak for .only execution (#18961)
- Loading branch information
1 parent
de4fca3
commit b7002bf
Showing
9 changed files
with
158 additions
and
1,457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/driver/cypress/integration/e2e/testConfigOverrides-describe-only_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const shouldNotExecute = () => { | ||
throw new Error('Test Override validation should have failed & it block should not have executed.') | ||
} | ||
|
||
it('first should not run', () => { | ||
shouldNotExecute() | ||
}) | ||
|
||
describe('second should not run', () => { | ||
it('test', () => { | ||
shouldNotExecute() | ||
}) | ||
}) | ||
|
||
describe('correctly applies overrides ', { retries: 1 }, () => { | ||
// eslint-disable-next-line mocha/no-exclusive-tests | ||
describe.only('when valid configuration', () => { | ||
it('for describe.only', { baseUrl: null }, () => { | ||
const config = Cypress.config() | ||
|
||
expect(config.testConfigList).to.be.undefined | ||
expect(config.unverifiedTestConfig).to.be.undefined | ||
expect(config.baseUrl).to.be.null | ||
expect(config.retries).to.eq(1) | ||
}) | ||
}) | ||
}) |
25 changes: 25 additions & 0 deletions
25
packages/driver/cypress/integration/e2e/testConfigOverrides-it-only_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const shouldNotExecute = () => { | ||
throw new Error('Test Override validation should have failed & it block should not have executed.') | ||
} | ||
|
||
it('first should not run', () => { | ||
shouldNotExecute() | ||
}) | ||
|
||
describe('second should not run', () => { | ||
it('test', () => { | ||
shouldNotExecute() | ||
}) | ||
}) | ||
|
||
describe('correctly applies overrides when valid configuration', { retries: 1 }, () => { | ||
// eslint-disable-next-line mocha/no-exclusive-tests | ||
it.only('for it.only', { baseUrl: null }, () => { | ||
const config = Cypress.config() | ||
|
||
expect(config.testConfigList).to.be.undefined | ||
expect(config.unverifiedTestConfig).to.be.undefined | ||
expect(config.baseUrl).to.be.null | ||
expect(config.retries).to.eq(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b7002bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
b7002bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
b7002bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: