Skip to content

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

@emilyrohrbough

Description

@emilyrohrbough

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions