Skip to content

Add no-failing-hooks rule #108

@jamestalmage

Description

@jamestalmage

While the failing modifier could technically be used for a hook (avajs/ava#831 (comment)), it's probably a mistake in most cases.

Rather than outlawing it in AVA, I think it would be best to make a rule here that defaults to an error if they use the failing modifier on any hooks (before, beforeEach, after, etc.). Users can then disable with a eslint comment if they really meant to do it.

Optionally, we could add an allowedHooks config option.

Perhaps it's not even worth doing this, since the intent is to have AVA print the failing tests in red eventually (which should be warning enough, even if it is in a hook).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions