Tests must be able to fail
Flags tests in test files that cannot fail:
- Empty bodies written on one line:
it('x', () => {}),test("x", async () => {}),def test_x(): pass,func TestX(t *testing.T) {}, RSpecit 'x' do end. - Assertions on constants:
expect(true).toBe(true),expect(1).toBe(1),assert(true),assert True,self.assertTrue(True),assert!(true),assertTrue(true),Assert.True(true).
A multi-line empty body is not detected; the one-line forms are what placeholder tests usually look like. Commented-out lines are ignored.
Why it matters with coding agents: a placeholder test turns “add tests” into a green checkmark and a higher test count, with nothing checked.
WARN only: nothing is blocked. The frame sees the files as pushed, so it reports every case present, not only new ones.
Fix#
Write the test’s real assertion, or delete the placeholder. If one is
intentional (a smoke test that only checks the module loads), record why: a
whitelist entry with a reason, or
appframes:disable-next-line app-correctness/no-placeholder-tests in a comment
above it.
WARN lets the push through and records the finding. Turn frames on per repo on the dashboard's Policy page - see choosing what the gate checks.
Source on GitHub Live demo How it works Questions: contact@nimblegate.com