Skip to content

--fail-fast doesn't work with describe/test #6348

@dandv

Description

@dandv

Describe the bug

Passing --fail-fast to deno test is documented to stop on the first failure. This works with Deno.test(), but not with describe / expect.

Steps to Reproduce

main_test.ts:

import { describe, test } from '@std/testing/bdd';
import { assertEquals } from "@std/assert";

describe('addition', () => {
  test(function addTest1() {
    assertEquals(1 + 1, 42);
  });

  test(function addTest2() {
    assertEquals(2 + 2, 4);
  });
});
$ deno test --fail-fast
Check file:///home/dandv/deno-bugs/main_test.ts
running 1 test from ./main_test.ts
addition ...
  addTest1 ... FAILED (7ms)
  addTest2 ... ok (1ms)
addition ... FAILED (due to 1 failed step) (12ms)

 ERRORS

addition ... addTest1 => https://jsr.io/@std/testing/1.0.9/_test_suite.ts:393:15
error: AssertionError: Values are not equal.
[...]

Expected behavior

addTest2 should not have executed.

Environment

  • OS: Fedora Linux 38
  • deno version: 2.1.4
  • std version: @std/testing@^1.0.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsuggestiona suggestion yet to be agreed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions