Skip to content

Remove ifError assertion? #1720

Description

@novemberborn

Should we remove the t.ifError() assertion? It's functionally equivalent to t.falsy(). I suppose it's meant to be a "fail test if this variable contains an error" kind of assertion:

test.cb('look no error', t => {
  obj.asyncWithCallback((err, result) => {
    t.ifError(err); // Guard against there being an error
    t.is(result.value, 'bob'); // Now access `result`
    t.end(); // Aaaand done!
  });
});

This is odd though. t.end() can be passed an error, and besides we don't stop running the test implementation when an assertion fails so it doesn't do anything useful.

@avajs/core?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions