Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dandv opened this issue Jan 15, 2025 · 0 comments
Open

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

dandv opened this issue Jan 15, 2025 · 0 comments
Labels
enhancement New feature or request suggestion a suggestion yet to be agreed

Comments

@dandv
Copy link
Contributor

dandv commented Jan 15, 2025

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
@dandv dandv added bug Something isn't working needs triage labels Jan 15, 2025
@kt3k kt3k added enhancement New feature or request suggestion a suggestion yet to be agreed and removed bug Something isn't working needs triage labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request suggestion a suggestion yet to be agreed
Projects
None yet
Development

No branches or pull requests

2 participants