Skip to content

this.skip behavior differs from mocha #40

@pludov

Description

@pludov

The skip method in mocha only skips the current test case, not the others.

But within a step, the behavior of this.skip is different: subsequent steps get ignored

Example:

describe('Skip & step interaction ', function() {
    step('step 1', async function() {
        console.log('hello 1');
    });

    step('step 2', async function() {
        this.skip();
        console.log('hello 2');
    });

    step('step 3', async function() {
        // This step should probably run, yet it get skipped
        console.log('hello 3');
    });
});

Produces the following output:

  Skip & step interaction 
hello 1
    ✓ step 1
    - step 2
    - step 3

(Used mocha 6.2.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions