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

[WIP] Add error for suites without callback functions #3651

Closed
wants to merge 11 commits into from

Conversation

lilaconlee
Copy link
Contributor

@lilaconlee lilaconlee commented Mar 5, 2019

@lilaconlee lilaconlee changed the title WIP: Add error for suites without callback functions Add error for suites without callback functions Mar 12, 2019
Copy link
Member

@brian-mann brian-mann left a comment

Choose a reason for hiding this comment

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

There's a better and more direct way to test for this. The problem is that this possibly creates an edge case where no tests have been added but not because the suite is missing a callback function. You could likely have an empty suite above the problematic one - or rather you could also have a TypeError that causes this without being directly related to the suites either.

The more solution is to override mocha's function handling of suites and detect whether fn is undefined and immediately throw a precise error there instead of appending this to the bottom of the uncaught error.

Mocha parses the suites at a very specific (and early) time in the process and that area can be handled specifically.

@jennifer-shehane jennifer-shehane self-assigned this Jul 3, 2019
@jennifer-shehane jennifer-shehane changed the title Add error for suites without callback functions [WIP] Add error for suites without callback functions Jul 15, 2019
@cypress
Copy link

cypress bot commented Dec 18, 2019



Test summary

3584 0 47 0


Run details

Project cypress
Status Passed
Commit 653431e
Started Dec 18, 2019 9:40 AM
Ended Dec 18, 2019 9:45 AM
Duration 04:40 💡
OS Linux Debian - 9.11
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this PR due to inactivity. Please open a new PR to address the original 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

Successfully merging this pull request may close these issues.

Crash if a "describe" block does not have a callback function
3 participants