Skip to content

[Bug]: Tests marked as .todo inside describe.only blocks are shown as "skipped" #13482

Closed

Description

Version

29.2.1

Steps to reproduce

I've provided this small repo with 2 test files: https://github.com/ramos-ph/jest-todo-issue

To reproduce:

  1. Clone the repo
  2. Run npm install
  3. Run npx jest --verbose, so you can see the output.

Expected behavior

I expect to see all of the tests labeled as todo, instead of having tests labeled as "skipped"

Actual behavior

The tests labeled as .todo inside a describe.only block are not labeled correctly as such, instead, labeled as "skipped"

Additional context

The output of npx jest --verbose:

 PASS  ./correct.test.js
  without .only, should show 'passed', 'todo', 'todo'
    ✓ passing test
    ✎ todo todo test 1
    ✎ todo todo test 2

 PASS  ./bug.test.js
  with .only, should show 'passed', 'todo', 'todo'
    ✓ passing test (1 ms)
    ○ skipped todo test 1
    ○ skipped todo test 2

Test Suites: 2 passed, 2 total
Tests:       2 skipped, 2 todo, 2 passed, 6 total
Snapshots:   0 total
Time:        0.393 s, estimated 1 s
Ran all test suites.

Environment

System:
    OS: Linux 5.10 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.19 - /mnt/c/Users/Pedro Ramos/AppData/Roaming/npm/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  npmPackages:
    jest: ^29.2.1 => 29.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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