Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.04 KB

no-identical-titles.md

File metadata and controls

53 lines (40 loc) · 1.04 KB

uvu/no-identical-titles

Enforce each test case to have a unique title.

Rationale

Duplicate test titles make it hard to find failing tests. This rule encourages users to define a unique title to each test.

Examples

Examples of incorrect code for this rule:

import { test } from "uvu";
test("foo", () => {});
test("foo", () => {});
import { suite } from "uvu";
const foo = suite("foo");
foo("bar", () => {});
foo("bar", () => {});
import { suite } from "uvu";
const foo = suite("foo");
const bar = suite("foo");

Examples of correct code for this rule:

import { test } from "uvu";
test("foo", () => {});
test("bar", () => {});
import { suite } from "uvu";
const foo = suite("foo");
foo("baz", () => {});
const bar = suite("bar");
// This is OK because the tests are under different suites.
bar("baz", () => {});

Resources