Skip to content

[Bug]: Reporter.onTestCaseResult not called for test.todo in Jest 27 #12184

@segrey

Description

@segrey

Version

27.4.5

Steps to reproduce

Reporter.onTestCaseResult doesn't get called on test.todo.

// my.test.js
test.todo('my todo');
test('my test', () => {});
// my-reporter.js
class MyReporter {
    onTestCaseResult(test, testCaseResult) {
        console.log('onTestCaseResult: ' + testCaseResult.title);
    }
}

module.exports = MyReporter;

Expected behavior

jest --reporters ./my-reporter.js should print:

Determining test suites to run...onTestCaseResult: my test
onTestCaseResult: my todo

Actual behavior

Actually, jest --reporters ./my-reporter.js prints:

Determining test suites to run...onTestCaseResult: my test

Additional context

No response

Environment

System:
    OS: Linux 5.4 Linux Mint 20.2 (Uma)
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  npmPackages:
    jest: ^27.4.5 => 27.4.5

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