Skip to content
Conduit

rule

no tautological tests

Avoid tautological tests that only restate fixture input

Set up

Skills are installed by placing their folder where your agent loads skills.

Part of the collection prisma/prisma-next.

Copy the text of no-tautological-tests.mdc into the instructions file your agent reads (CLAUDE.md, AGENTS.md, .cursor/rules, …). Written for AI coding agents in general (from where the project keeps it; we have not run it).

README

synced Oct 14, 2026

Avoid Tautological Tests

Tests must verify behavior, not mirror object shape passed by the test itself.

Rule

  • Prefer assertions that validate transformation, branching, integration behavior, error handling, or side effects.
  • Do not add tests that only confirm an object still contains fields copied directly from the test input.
  • If coverage pressure encourages low-value assertions, tune coverage configuration instead of adding meaningless tests.

Examples

❌ Avoid

const value = makeThing({ a: 1, b: 2 });
expect(value).toMatchObject({ a: 1, b: 2 });

When makeThing() only stores the same input fields, this adds little signal and mostly tests fixture setup.

✅ Prefer

const value = makeThing({ precision: 12 });
expect(value.normalize()).toBe('numeric(12)');
expect(() => makeThing({ precision: -1 })).toThrow();

These assertions validate behavior and error paths that can actually regress.

↑↓ navigate openesc close