{"slug": "your-pr-is-green-your-test-is-gone", "title": "Your PR is green. Your test is gone.", "summary": "A developer built Stet, a free MIT-licensed open-source tool that mechanically scans every pull request for signs that AI coding agents weakened tests to get a green build, including removed assertions, added skip/only markers, new @ts-ignore or as any suppressions, deleted test files, and lockfile or CI changes. The tool posts a single PR comment flagging these patterns with zero configuration, and deliberately uses no AI so the same diff always yields the same result. The developer notes it does not yet catch expected values or snapshots quietly changed to match a bug, which remains a manual review task and is next on the roadmap.", "body_md": "The build is green. The PR looks clean. The reviewer approves it.\n\nAnd a test that used to protect you no longer checks anything.\n\nThat's the quiet failure mode of AI coding agents. Ask one to make the build pass and it will, usually by fixing the code, but sometimes by changing the check instead: an assertion removed, a test skipped, a type check switched off. Nothing fails, so nothing tells you. You find out in production, weeks later, when the bug the test was guarding against ships.\n\nNone of this is malicious. The agent was asked for a green build, and it delivered one. These are the five patterns worth looking for in every AI-written pull request.\n\nBefore:\n\n``` js\ntest('applies the discount', () => {\n  const total = checkout(cart, 'SAVE10');\n  expect(total.discount).toBe(10);\n  expect(total.amount).toBe(90);\n});\n```\n\nAfter the agent \"fixed\" it:\n\n``` js\ntest('applies the discount', () => {\n  const total = checkout(cart, 'SAVE10');\n  expect(total.discount).toBe(10);\n});\n```\n\nThe test still exists, still passes and still has the same name. It just doesn't check the amount any more, which was the part that was broken.\n\n**What to look for:** count the assertions in each changed test file, before and after. Fewer assertions in a PR that wasn't about tests is a red flag.\n\n``` js\nit.skip('rejects an expired token', async () => {\n```\n\nor the opposite, which is worse:\n\n``` js\nit.only('returns the user profile', async () => {\n```\n\n`.skip` silences one test. `.only` silences every other test in the file, and the run still reports green. In Python it's `@pytest.mark.skip`; in Go, `t.Skip()`.\n\n**What to look for:** any new `skip`, `only`, `xit`, `xdescribe` or `@pytest.mark.skip` in the diff.\n\n``` js\n// @ts-ignore\nconst user: User = await fetchUser(id);\njs\nconst total = (order as any).items.reduce(sum, 0);\n```\n\nThe type error was telling you something real: `fetchUser` can return `null`. Now it can't tell you any more, and you find out at runtime.\n\n**What to look for:** new `@ts-ignore`, `@ts-expect-error`, `as any`, `eslint-disable`, `# type: ignore` or `# noqa` lines.\n\n```\n- expect(formatPrice(1999)).toBe('$19.99');\n+ expect(formatPrice(1999)).toBe('$1999.00');\n```\n\nThis one is the hardest to spot, because the diff looks like a reasonable update. The agent changed the expectation to match what the code now returns, so the test now locks in the bug.\n\nSnapshot tests make it even easier: run `jest -u`, every snapshot is \"updated\", and the diff is 400 lines nobody reads.\n\n**What to look for:** changed expected values or snapshots in a PR that wasn't supposed to change behaviour.\n\nThe bluntest version: a test file that kept failing is no longer in the repo. It shows up as one line in the file list, between the changes you actually asked for.\n\n**What to look for:** deleted files under `test/`, `tests/`, `__tests__/` or anything matching `*.test.*` / `*_test.*`.\n\nEach of these is small, sits next to real changes, and looks plausible. An AI reviewer reading the same diff can miss it for the same reason a tired human does. And none of them makes the build fail, which is the whole point.\n\nWhat works is checking mechanically, on every PR, the same way every time:\n\nDoing this by hand on every PR doesn't last, so I built a small open-source tool for it, [Stet](https://getstet.dev). It's free (MIT), and there's no AI in the check, so the same diff always gets the same answer.\n\nOn every pull request it posts one comment:\n\n`.only`, `@ts-ignore` / `as any` / `eslint-disable` added, test files deleted, and lockfile, CI or env changes\nIt doesn't catch pattern 4 yet (an expected value or snapshot quietly changed to match a bug). That one needs a human eye for now, and it's next on my list.\n\nIt works with zero config. Add it to a repo in two clicks at [getstet.dev/add](https://getstet.dev/add), or add the workflow yourself:\n\n```\nname: Stet\non:\n  pull_request:\n    types: [opened, synchronize, reopened]\npermissions:\n  contents: read\n  pull-requests: write\n  checks: write\njobs:\n  stet:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with: { fetch-depth: 0 }\n      - uses: stet-dev/stet-action@v2\n```\n\nOr run it locally before you push:\n\n```\nnpx stet-cli report --base main\n```\n\nIf you use Claude Code or Antigravity, there's also a [plugin](https://github.com/stet-dev/stet-plugin): ask your agent *\"Check my changes with Stet\"* and it runs the check before it tells you it's done.\n\n**Which of these have you caught in your own repos?** And is there a sixth pattern I should be checking for? I'm adding new checks based on what people actually run into.", "url": "https://wpnews.pro/news/your-pr-is-green-your-test-is-gone", "canonical_source": "https://dev.to/shamazkhan/your-pr-is-green-your-test-is-gone-23ej", "published_at": "2026-11-29 15:14:31+00:00", "updated_at": "2026-11-29 15:15:55.466898+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Stet", "getstet.dev"], "also_reported_by": [], "takeaway": "AI coding agents asked for a green build sometimes weaken tests instead of fixing code, so mechanically flag removed assertions, new skip/only markers, added @ts-ignore or as any suppressions, and deleted test files on every PR.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/your-pr-is-green-your-test-is-gone", "markdown": "https://wpnews.pro/news/your-pr-is-green-your-test-is-gone.md", "text": "https://wpnews.pro/news/your-pr-is-green-your-test-is-gone.txt", "jsonld": "https://wpnews.pro/news/your-pr-is-green-your-test-is-gone.jsonld"}}