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

Problem with mochawesome: TypeError: Cannot read properties of undefined (reading 'length') #373

Closed
quad5 opened this issue Mar 17, 2022 · 4 comments

Comments

@quad5
Copy link

quad5 commented Mar 17, 2022

Describe the bug
A clear and concise description of what the bug is.

I am using Cypress, and I am not sure whose bug this belongs to. What is happening is that it seems like html file isn't generated when I am running more than 1 spec file.

Code Reproduce
Link to repo where the issue can reliably be reproduced:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

image

image

Environment (please complete the following information):

  • Platform
  • mochawesome version
    "cypress-mochawesome-reporter": "3.0.0",
    "mochawesome": "7.1.2"
  • mocha (or other test library) version
    mocha: 9.2.2
  • Node version
    Node: 16.5.0

Additional context
Add any other context about the problem here.

@adamgruber
Copy link
Owner

Please provide steps to reproduce.

@jaltmanQ
Copy link

Ran into this issue myself. The problem was a utility file in the cypress/integration folder that had no tests in it.

@Idleness76
Copy link

Ran into this issue myself. The problem was a utility file in the cypress/integration folder that had no tests in it.

@jaltmanQ - I'm seeing a similar error and I do not have a cypress/integration folder present at all.

@adamgruber - This problem seems to be occurring not just with multiple spec files - but instead (for me at least), this happens when tests may not be run even though Cypress sees them. I'll try to explain concisely. In my project I have setup spec files to have tags and when Cypress is run, I specify 1 or more tags. If multiple spec files exist AND the tags match all spec files present, then the reports are generated without any issue. Even if some files don't actually run tests. I verified that by including a spec file with 1 test, and marked it as it.skip().

The more specific problem, when I see this error, is when there are multiple spec files present but the used tag means that Cypress will skip over 1 or more. This is the case when the error occurs for me. This is new behaviour - but I'm not certain how recent as I've unfortunately just upgraded from versions I was using a few months ago.

I can say with some conviction that before making upgrades to several packages recently - cypress-mochawesome-reporter included - that this problem did not exist and no errors were generated when spec files were present that were skipped over.

@adamgruber
Copy link
Owner

Released 7.1.3 to address this issue.

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

No branches or pull requests

4 participants