Skip to content

Add chainable .always method #474

@therealklanni

Description

@therealklanni

Implement chainable always method.

From @jamestalmage's comment below:

What if it's always, and chainable:

test.always - even if a beforeEach fails.
test.afterEach.always - even if a test fails.
test.after.always - the OPs request.

Not sure the first one makes sense.

Original message

Near as I can figure, the .after() hook is only being ran if the tests have passed. I have a test file something like this (simplified/pseudo for clarity)

// ... imports

test('create a file', ...) // passes

test('do something else', ...) // fails

// ... other tests

test.after('clean up created files', ...) // never runs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions