Skip to main content
ai-slop/tautological-testmanual fix

Tautological test.

A test assertion that compares two fixed literals, such as `expect(true).toBe(true)` or `assert True`. It cannot fail and proves nothing about the code.

Flagged shape and clean shape.

Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.

tautological-test.ts
✗ Flagged
describe('applyDiscount', () => {
  it('applies a percentage discount', () => {
    applyDiscount(cart, 'SPRING10')
    expect(true).toBe(true)
  })
})
Why this trips

Deterministic line match on test files: flags `expect(literal).toBe(literal)` and `assert.equal`/`assert.strictEqual(literal, literal)` with equal literals in JS/TS, and a bare `assert True` line in Python.

tautological-test.ts
✓ Clean
describe('applyDiscount', () => {
  it('applies a percentage discount', () => {
    const result = applyDiscount(cart, 'SPRING10')
    expect(result.total).toBe(90)
  })
})
What changed

Call the code under test and assert on its output or effects.

Asked to add tests, agents sometimes produce placeholder assertions that make the suite pass without exercising the code under test.

How this rule is justified.

Rule id

ai-slop/tautological-test

Enforcing engine

ai-slop

Detector strategy

Deterministic line match on test files: flags `expect(literal).toBe(literal)` and `assert.equal`/`assert.strictEqual(literal, literal)` with equal literals in JS/TS, and a bare `assert True` line in Python.

Legitimate code that is NOT flagged

Assertions on values produced by the code under test, comparisons of unequal literals, and production (non-test) files are not flagged.

Evidence

Part of aislop's test-quality checks, scored in the standard tier: a high-confidence test gap that does not break production directly.