Skip to content

Bug: --bail flag does not bail #2867

@JoshCheek

Description

@JoshCheek

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

The --bail flag does not stop running tests after the first failure.

Steps to reproduce

$ git clone https://github.com/JoshCheek/jest-bug--bail-flag
$ cd jest-bug--bail-flag/
$ npm install
$ npm test

What is the expected behavior?

Exit the test suite immediately upon the first failing test, the one named "2: fail".

What is the actual behaviour?

It runs the full test suite.

Demo

jest-bug2

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

No configuration outside the repo I linked above..

$ npm run exec jest -- --version
v18.1.0

$ node --version
v7.2.1

$ npm --version
3.10.9

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.6 (15G1004)
      Kernel Version: Darwin 15.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Josh’s MacBook Air (2)
      User Name: Josh Cheek (josh)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 19 days 12:03

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions