Skip to content

Typescript declarations are using deprecated Mocha interfaces #5795

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

Closed
CSchulz opened this issue Nov 26, 2019 · 3 comments · Fixed by #8613
Closed

Typescript declarations are using deprecated Mocha interfaces #5795

CSchulz opened this issue Nov 26, 2019 · 3 comments · Fixed by #8613

Comments

@CSchulz
Copy link

CSchulz commented Nov 26, 2019

Current behavior:

  Cypress.on('test:after:run', (test, runnable) => {
    if (test.state === 'failed') {
      // leads to 'parent' is deprecated. `.parent` has type `Mocha.Suite | undefined` in `Mocha.Test`.
      const screenshotFileName = `${runnable.parent!.title} -- ${test.title} (failed).png`;
    }
  });

Desired behavior:

Should not be deprecated.

Versions

3.6.1

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Nov 26, 2019
@drewbrend
Copy link

I just came here to log this. I would like this to be fixed as well. It is currently returning Mocha.ITest but should be returning Mocha.Test. It seems like there are other deprecated Mocha interfaces returned as well, but I hit this same one from test:after:run.

Also there are properties missing from Mocha.Test, like timings, but that'll be an issue I'll log with them/DefinitelyTyped.

@cypress-bot cypress-bot bot added stage: ready for work The issue is reproducible and in scope and removed stage: needs review The PR code is done & tested, needs review labels Feb 26, 2020
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress labels Sep 18, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 18, 2020

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 29, 2020

Released in 5.3.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants