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

Cypress v11 cypress run crashes when assertion in test fails #24652

Closed
niklasvieth opened this issue Nov 11, 2022 · 6 comments · Fixed by #24677
Closed

Cypress v11 cypress run crashes when assertion in test fails #24652

niklasvieth opened this issue Nov 11, 2022 · 6 comments · Fixed by #24677
Assignees

Comments

@niklasvieth
Copy link

Current behavior

If an assertion in a test fails by running cypress run --browser chrome the whole process fails instead of showing the result of one failing test in the console as report.
Fails with following error:

u(...).generateDiff is not a function
TypeError: u(...).generateDiff is not a function
    at T.getTestcaseData (<embedded>:1144:21700)
    at T.<anonymous> (<embedded>:1144:19702)
    at R.emit (node:events:539:35)
    at S.emit (<embedded>:2755:16640)
    at Object.onMocha (<embedded>:2802:338633)
    at p.<anonymous> (<embedded>:2802:66203)
    at p.emit (node:events:527:28)
    at p.emitUntyped (<embedded>:2527:41392)
    at <embedded>:2527:48899
    at process.processTicksAndRejections (node:internal/process/task_queues:78:11)

Desired behavior

Show the failing test result in the report table same as in v10.11

Test code to reproduce

it("Faulty test", () => {
   expect(3).to.equal(4);
}

Cypress Version

11.0.0 or 11.0.1

Node version

v16.14.2

Operating System

macOS Ventura 13.0

Debug Logs

No response

Other

No response

@petergaal91
Copy link

Same issue here. And I have a strange message at the start:

Couldn't determine Mocha version

@fabian-froehlich
Copy link

fabian-froehlich commented Nov 11, 2022

I am experiencing the same issue when running tests in cli. The cypress GUI runner works as before.

import {defineConfig} from "cypress"

export default defineConfig({
  e2e: {
    baseUrl: "http://localhost:3001"
  },
  reporter: "junit",
  reporterOptions: {
    mochaFile: "cypress/results/junit-report-[hash].xml",
    testCaseSwitchClassnameAndName: true
  },
  video: false,
  viewportHeight: 1080,
  viewportWidth: 1920
})

@handerss-spotfire
Copy link

We experience the same issue, also using "junit" reporter with "mochaFile" option.

@BoreasMun
Copy link

Same here, "junit" with "mochaFile"

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 14, 2022

The code for this is done in cypress-io/cypress#24677, 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 14, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 15, 2022

Released in 11.1.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 15, 2022
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.

6 participants