Skip to content

jest-circus changes behaviour of it.only inside describe.only #7837

@theneva

Description

@theneva

🐛 Bug Report

jest-circus runs all its inside a describe.only block regardless of it.only:

image

This differs from jest-jasmine2, which only runs the it marked with it.only.

image

To Reproduce

Run a test suite containing a describe.only block with at least one it.only and one it. Please see the above screenshots.

Expected behavior

I would expect jest-circus and jest-jasmine2 to run the same set of tests, unless this is an intentional difference 😄

Link to repl or repo (highly encouraged)

The repo used to grab the screenshots is available at https://github.com/theneva/jest-only.

Run npx envinfo --preset jest

Paste the results here:

$ npx envinfo --preset jest

npx: installed 1 in 1.511s

  System:
    OS: macOS 10.14.2
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
  npmPackages:
    jest: ^24.1.0 => 24.1.0

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