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

chore: add types for Cypress.session.clearAllSavedSessions #19412

Merged
merged 7 commits into from Dec 20, 2021

Conversation

IanVS
Copy link
Contributor

@IanVS IanVS commented Dec 17, 2021

User facing changelog

n/a

Additional details

I only added the public method that's documented, although there are other methods available.

I'm not positive I did this right. 😬 And I didn't see any type tests to modify. Is the return type of Promise<void> correct?

How has the user experience changed?

Typescript types for Cypress.session should now be available.

PR Tasks

  • [na] Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 17, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

@@ -3117,6 +3122,11 @@ declare namespace Cypress {
onAnyAbort(route: RouteOptions, proxy: any): void
}

interface Session {
clearAllSavedSessions: () => Promise<void>;
Copy link
Member

Choose a reason for hiding this comment

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

Mind adding a comment to describe clearAllSavedSessions? It helps with maintenance. You can pull something from https://docs.cypress.io/api/cypress-api/session.

Copy link
Member

Choose a reason for hiding this comment

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

It mentions something like; Clear all saved sessions and re-run the current spec file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah sorry, I missed that at first. :shame:

Copy link
Member

Choose a reason for hiding this comment

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

No worries! It's not super obvious

@emilyrohrbough emilyrohrbough changed the title Add types for Cypress.session chore: add types for Cypress.session.clearAllSavedSessions Dec 17, 2021
@jennifer-shehane jennifer-shehane requested review from a team and jennifer-shehane and removed request for a team and jennifer-shehane December 19, 2021 09:24
@emilyrohrbough emilyrohrbough merged commit 420a9be into cypress-io:develop Dec 20, 2021
@IanVS IanVS deleted the 19363-cypress.session-type branch December 20, 2021 21:42
tgriesser added a commit that referenced this pull request Dec 21, 2021
…ert-with-stack

* tgriesser/10.0-release/refactor-lifecycle: (50 commits)
  Remove unused test file
  update task spec to use correct projectRoot
  update
  Fix test
  Fix test
  Fix tests
  update tests
  fix test
  correct config path
  Fix TS
  resolve conflicts
  Fixing component & e2e tests
  build: fix dev process on windows (#19401)
  fix: `cy.contains()` ignores `<style>` and `<script>` without removing them. (#19424)
  Fix some tests
  chore: Fix the broken codeowners automation (#19431)
  chore: add types for Cypress.session.clearAllSavedSessions (#19412)
  fix: No unnecessary snapshotting (#19311)
  chore: Remove pkg/driver @ts-nocheck part 1 (#19353)
  fix: add CYPRESS_VERIFY_TIMEOUT param and a test for it (#19282)
  ...
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.

[typescript] Cypress.session type does not exist
4 participants