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

describe.skip is not working as expected #74

Closed
macropace opened this issue Oct 20, 2019 · 2 comments
Closed

describe.skip is not working as expected #74

macropace opened this issue Oct 20, 2019 · 2 comments

Comments

@macropace
Copy link

When describe.skip is used in mocha tests, tests are failing with error Uncaught TypeError: Cannot convert undefined or null to object

Context

When describe.skip is used, mocha Suite._beforeAll array will be empty. In beforeSuite event handler we are trying to add nemo's beforeAll to the front of the actual mocha beforeAll array here https://github.com/krakenjs/nemo/blob/master/lib/runner/mocha.js#L89. When Suite._beforeAll is empty and when we do Suite._beforeAll.unshift(Suite._beforeAll.pop()) we are adding undefined to Suite._beforeAll array. When mocha tries to clean references by deleting reference test function as shown here https://github.com/mochajs/mocha/blob/master/lib/suite.js#L527 it is causing the above error

Solution

Adding a check for empty error would solve the problem

@macropace macropace reopened this Oct 20, 2019
grawk added a commit that referenced this issue Oct 23, 2019
@grawk
Copy link
Member

grawk commented Jun 24, 2020

@macropace can you confirm this is now fixed?

@macropace
Copy link
Author

macropace commented Jun 24, 2020

@grawk This issue has been fixed

@grawk grawk closed this as completed Nov 9, 2021
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

2 participants