You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
When
describe.skip
is used in mocha tests, tests are failing with errorUncaught TypeError: Cannot convert undefined or null to object
Context
When describe.skip is used, mocha
Suite._beforeAll
array will be empty. InbeforeSuite
event handler we are trying to addnemo's beforeAll
to the front of the actual mocha beforeAll array here https://github.com/krakenjs/nemo/blob/master/lib/runner/mocha.js#L89. WhenSuite._beforeAll
is empty and when we doSuite._beforeAll.unshift(Suite._beforeAll.pop())
we are addingundefined
toSuite._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 errorSolution
Adding a check for empty error would solve the problem
The text was updated successfully, but these errors were encountered: