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

🐛 Bug: Exception in a reporter silently crashes Mocha #980

Open
rassie opened this issue Sep 20, 2013 · 3 comments
Open

🐛 Bug: Exception in a reporter silently crashes Mocha #980

rassie opened this issue Sep 20, 2013 · 3 comments
Labels
status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer

Comments

@rassie
Copy link

rassie commented Sep 20, 2013

If a reporter raises an exception, Mocha just stops without any error message. An example reporter demonstrating the problem (needs a failing test in the suite):

module.exports = Crash;

var Spec = require('mocha/lib/reporters/spec');

function Crash(runner) {
    Spec.call(this, runner);

    runner.on('fail', function(test, err){
        throw new Error();
    });
}

Crash.prototype.__proto__ = Spec.prototype;
@rassie
Copy link
Author

rassie commented Sep 20, 2013

This is the case with Node 0.8, with Node 0.10 there is at least a stack strace. Nevertheless, an error message like "Reporter has crashed" would be nice.

@boneskull boneskull added the type: feature enhancement proposal label Apr 9, 2015
@boneskull
Copy link
Contributor

this would be helpful.

@reesew
Copy link

reesew commented Jan 28, 2016

+2
I'm not even sure how to get the stack trace

@boneskull boneskull added type: bug a defect, confirmed by a maintainer status: accepting prs Mocha can use your help with this one! and removed type: feature enhancement proposal labels Oct 18, 2017
@JoshuaKGoldberg JoshuaKGoldberg changed the title Exception in a reporter silently crashes Mocha 🐛 Bug: Exception in a reporter silently crashes Mocha Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Mocha can use your help with this one! type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants