{
  "id": 3875795,
  "title": "A test said the server started. I deleted the server. It still passed.",
  "url": "https://urgent.news/2026/08/28/a-test-said-the-server-started-i-deleted-the-server-it-still-passed",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-28T03:18:57.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/zkasuran/a-test-said-the-server-started-i-deleted-the-server-it-still-passed-5gch"
  },
  "original_language": "en",
  "account": "A Node.js project demonstrates a flawed testing pattern that allows tests to pass even when the underlying code fails. In a real-world scenario, a test was executed that started a server, and despite the server never coming up due to a deleted section of the build function, the test still passed. This occurred because the test only asserted a boolean true value, rather than verifying the server's functionality. Similar occurrences were found in multiple tests within the same project, as well as in other projects like Fastify. These patterns involve tests asserting true or other trivial assertions, catching errors that are never actually tested, and tests that run but do not verify the intended functionality. While coverage tools may indicate these tests are being executed, they do not guarantee the tests would fail if the code changes in a regression scenario. The issue can be identified using a scanner like margyn-scan, which flags tests that assert nothing or where the assertion always holds true regardless of the code's behavior. This highlights the importance of reviewing tests thoroughly, as a green suite does not guarantee the tests would fail on a regression, and further auditing is necessary to ensure test reliability.",
  "summary": "Here is a test from a real, well run Node project: test ( ' server starts ' , async ( t ) => { const app = build () await app . listen ({ port : 0 }) t . assert . ok ( true , ' server started ' ) }) It reads fine in review. It runs green. Now delete the body of build() so the server never comes up. The test is still green, because the only thing it asserts is true . In the same file two more of…",
  "key_points": [
    "Test started server but it never came up",
    "Test passed despite server failure",
    "Scanner flags tests asserting true values"
  ],
  "editors_take": "This flawed testing pattern undermines the reliability of test results, as passing tests do not guarantee the code functions as intended, leaving room for undetected regressions.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}