Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Configuration data leaking into configuration for describe.only & it.only blocks #18959

Closed
emilyrohrbough opened this issue Nov 17, 2021 · 2 comments · Fixed by #18961
Closed
Assignees

Comments

@emilyrohrbough
Copy link
Member

Current behavior

@davidmunechika discovered the test configuration was not applying correctly for single suite/test execution. When Cyress starts, the runner normalize's the mocha runnables, which is where we determine the expected test configuration. When the runner filters for a suite or test that has marked as the only one that should run, the runner re-normalizes the mocha runnables. At this point, the test configuration has been formatted with the invocation details to determine where the configuration has been passed if the configuration fails its validation.

Desired behavior

The test configuration should not leak the testConfigList or unverifiedTestOverrides data onto the configuration when a suite or test is marked as the only block to execute.

Test code to reproduce

describe('my suite', () => {
  describe.only('my nested suite', () => {
    it('my test', () => {
      expect(Cypress.config('testConfigList')).to.be.undefined
      expect(Cypress.config('unverifiedTestConfig')).to.be.undefined
    })
  })
})
describe('my suite', () => {
  it.only('my test', () => {
    expect(Cypress.config('testConfigList')).to.be.undefined
    expect(Cypress.config('unverifiedTestConfig')).to.be.undefined
  })
})

Cypress Version

9.0.0

Other

No response

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 22, 2021

The code for this is done in cypress-io/cypress#18961, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Nov 22, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 23, 2021

Released in 9.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant