Skip to content

Runner#fail is getting executed with an instance of Pending #2337

@dasilvacontin

Description

@dasilvacontin

code smell: #946 (comment)

mocha/lib/runner.js

Lines 221 to 234 in 8a37e01

Runner.prototype.fail = function(test, err) {
++this.failures;
test.state = 'failed';
if (!(err instanceof Error || err && typeof err.message === 'string')) {
err = new Error('the ' + type(err) + ' ' + stringify(err) + ' was thrown, throw an Error :)');
}
err.stack = (this.fullStackTrace || !err.stack)
? err.stack
: stackFilter(err.stack);
this.emit('fail', test, err);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalethis has been inactive for a while...status: waiting for authorwaiting on response from OP or other posters - more information needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions