Skip to content

Files

Latest commit

 

History

History
31 lines (23 loc) · 650 Bytes

prefer-lowercase-title.md

File metadata and controls

31 lines (23 loc) · 650 Bytes

Pattern: Capitalized test title

Issue: -

Description

Test titles should begin with lowercase letters to maintain consistency and provide more readable test failures. Exceptions can be configured for specific test functions or allowed prefixes.

Examples

Example of incorrect code:

it("Adds numbers correctly", () => {
  expect(add(1, 2)).toBe(3);
});

test("Returns valid data", () => {
  expect(getData()).toBeDefined();
});

Example of correct code:

it("adds numbers correctly", () => {
  expect(add(1, 2)).toBe(3);
});

test("returns valid data", () => {
  expect(getData()).toBeDefined();
});