-
Notifications
You must be signed in to change notification settings - Fork 666
Open
Labels
Description
Describe the bug
If a test file has a beforeAll hook and a test.only, the error: Test failed because the "only" option was used that Deno normally displays is silently swallowed.
This is dangerous in CI/CD pipelines if a developer accidentally commits a test.only(...) because it would cause CI to pass without any warnings, skipping all other tests in the file.
Steps to Reproduce
import { beforeAll, describe, test } from "@std/testing/bdd";
beforeAll(() => {
console.log("beforeAll: setup runs here");
});
// describe("suite A", () => { // the error is swallowed with or without the outer describe block
test("test A1", () => {
console.log("test A1 ran");
});
test.only("test A2 - FOCUSED", () => {
console.log("test A2 ran (focused with .only)");
});
test("test A3", () => {
console.log("test A3 ran");
});
// });Expected behavior
Deno should always show the error "Test failed because the 'only' option was used" if a test or describe is focused with .only.
Environment
- OS: Ubuntu 24
- deno version: 2.6.8 (stable, release, x86_64-unknown-linux-gnu) v8 14.5.201.2-rusty, typescript 5.9.2
- std version: 1.0.17
Reactions are currently unavailable