Skip to content

What is the purpose for this test state determination logic? #102

@naomi-sharif

Description

@naomi-sharif

Hello 👋

I'm confused about the following logic for determining the test state upon the test ending.

Why is the default state PASSED?

When prepending an event listener to the EVENT_SUITE_END event, I noticed the tests within the suite would have the status of undefined. Is this the reason for the logic? If so, why is it the case that the test statuses are undefined when the suite has ended?

onTestFinish(test) {
const status = test.state || (test.pending && testStatuses.SKIPPED) || testStatuses.PASSED;
this.finishTest(test, status);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions