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

fix: "cannot access variable before initialization" errors in route2 #8978

Merged
merged 2 commits into from Oct 29, 2020

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Oct 27, 2020

User facing changelog

Cannot access 'continueSent' before initialization error happened intermittently. This PR fixes this issue.

Additional details

  • Why was this change necessary? => Fix flaky failures.
  • What is affected by this change? => N/A
  • Any implementation details to explain? => It was happening because let variables should be used after its declaration unlike var variables. I fixed this by reordering declarations.

How has the user experience changed?

N/A

PR Tasks

  • Have tests been added/updated? => Adding tests is a bit tricky. We can copy and paste the test in this comment, but it might not alarm even if there is an error because it's a flaky failure.
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [N/A] Has a PR for user-facing changes been opened in cypress-documentation?
  • [N/A] Have API changes been updated in the type definitions?
  • [N/A] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 27, 2020

Thanks for taking the time to open a PR!

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @sainthkh :)

@flotwig
Copy link
Contributor

flotwig commented Oct 28, 2020

Regarding adding tests... I wonder if a linter rule could catch this

@flotwig
Copy link
Contributor

flotwig commented Oct 28, 2020

Bleh, I tried adding the no-use-before-define rule but it turns out we have about 1,000,000 no-use-before-define violations in our codebase, so...

@flotwig flotwig merged commit 756b6b8 into cypress-io:develop Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cy.route2 errors leak between tests
3 participants