Skip to content

[🐛 Bug]: Jasmine pending() inside it() block is reported as "passed" instead of "skipped" in WDIO v9 #14688

@amoscmc

Description

@amoscmc

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

v9.15.0

Node.js Version

v22.12.0

Mode

WDIO Testrunner

Which capabilities are you using?

What happened?

A test that calls pending() inside an it() block is incorrectly reported as passed by the WDIO v9 spec reporter.

What is your expected behavior?

The test should be reported as skipped in the WDIO test summary.

How to reproduce the bug.

Create a file with the following code:

describe('Tests', () => {
    it('Test Pending', async () => {
        pending('This test is pending and will not run.');
        console.log('Test Pending');
    }, 10 * 60_000);

    xit('Test Skipped', async () => {
        console.log('Test Skipped');
    }, 10 * 60_000);

    it('Test Regular', async () => {
        console.log('Test Regular');
        expect(true).toBe(true);
    }, 10 * 60_000);
});

Minimal reproduction Github project: https://github.com/amoscmc/wdio-v9-jasmine-pending-bug

Relevant log output

[chrome 138.0.7204.49 linux #0-0] Tests
[chrome 138.0.7204.49 linux #0-0]     Test Pending
[chrome 138.0.7204.49 linux #0-0]
[chrome 138.0.7204.49 linux #0-0]       .........Pending Reasons.........
[chrome 138.0.7204.49 linux #0-0]          Temporarily disabled with xit
[chrome 138.0.7204.49 linux #0-0]    - Test Skipped
[chrome 138.0.7204.49 linux #0-0]     Test Regular
[chrome 138.0.7204.49 linux #0-0]
[chrome 138.0.7204.49 linux #0-0] 2 passing (80ms)
[chrome 138.0.7204.49 linux #0-0] 1 skipped

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions