Skip to content

Files

Latest commit

 

History

History
31 lines (23 loc) · 575 Bytes

consistent-test-it.md

File metadata and controls

31 lines (23 loc) · 575 Bytes

Pattern: Inconsistent test declaration

Issue: -

Description

Using a mix of test() and it() in test suites reduces consistency and readability. Test declarations should use the same function throughout the codebase.

Examples

Example of incorrect code:

test("first test", () => {
  expect(value).toBe(true);
});

it("second test", () => {
  expect(value).toBe(false);
});

Example of correct code:

test("first test", () => {
  expect(value).toBe(true);
});

test("second test", () => {
  expect(value).toBe(false);
});