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
If Date.now is stubbed to return an invalid value an exception happens in reporter causing that no report is generated and exit code from mocha is 0 even a test failed.
I know that stubbing Date.now like this is not the best idea but I think an exception in reporter should not result in swallowing failed tests.
The exception happens at line _suiteAttr.timestamp = new Date(_suiteAttr.timestamp).toISOString().slice(0, -5); in MochaJUnitReporter.prototype.getXml() because _suiteAttr.timestamp is 9000000000000000 which is to high for new Date().
The text was updated successfully, but these errors were encountered:
If
Date.now
is stubbed to return an invalid value an exception happens in reporter causing that no report is generated and exit code from mocha is 0 even a test failed.Reproducer:
I know that stubbing
Date.now
like this is not the best idea but I think an exception in reporter should not result in swallowing failed tests.The exception happens at line
_suiteAttr.timestamp = new Date(_suiteAttr.timestamp).toISOString().slice(0, -5);
inMochaJUnitReporter.prototype.getXml()
because_suiteAttr.timestamp
is9000000000000000
which is to high fornew Date()
.The text was updated successfully, but these errors were encountered: