{"record":{"id":"87cbf7966b75485a","repo":"evanw/esbuild","slug":"update-needed-expected-failure-for-basename","errorCode":null,"errorMessage":"UPDATE NEEDED: expected failure for ${basename}: ${test.name}, please remove this test from known failure list","messagePattern":"UPDATE NEEDED: expected failure for (.+?): (.+?), please remove this test from known failure list","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"scripts/uglify-tests.js","lineNumber":296,"sourceCode":"      log([\n        \"!!! failed\",\n        \"---INPUT---\",\n        \"{input}\",\n        \"---EXPECTED {expected_type}---\",\n        \"{expected}\",\n        \"---ACTUAL {actual_type}---\",\n        \"{actual}\",\n        \"\",\n        \"\",\n      ].join(\"\\n\"), {\n        input: input_formatted,\n        expected_type: typeof test.expect_stdout == \"string\" ? \"STDOUT\" : \"ERROR\",\n        expected: test.expect_stdout,\n        actual_type: typeof actual == \"string\" ? \"STDOUT\" : \"ERROR\",\n        actual: actual,\n      });\n    } else if (isExpectingFailure) {\n      throw new Error(`UPDATE NEEDED: expected failure for ${basename}: ${test.name}, please remove this test from known failure list`);\n    }\n  }\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// The code below was copied verbatim from \"uglify/demo/test/compress.js\"\n//\n// UglifyJS is released under the BSD license:\n//\n// Copyright 2012-2019 (c) Mihai Bazon <mihai.bazon@gmail.com>\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n//\n//     * Redistributions of source code must retain the above\n//       copyright notice, this list of conditions and the following\n//       disclaimer.","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/evanw/esbuild/blob/f6058f8364fe7ab91ca57a83e02577ed74c9cae4/scripts/uglify-tests.js#L278-L314","documentation":"Thrown at scripts/uglify-tests.js:296 inside the stdout-comparison step. A uglifyJS test is listed in the hardcoded known-failure list (lines 245-270) and `isExpectingFailure` is true, yet `sandbox.same_stdout(test.expect_stdout, actual)` now returns true — i.e. esbuild produces matching output where it previously differed. This is a positive signal: esbuild fixed the case, so the entry must be pruned from the list.","triggerScenarios":"Running the uglify test suite (typically under CI, since the known-failure list is only consulted when process.env.CI is set) after an esbuild change that makes a previously-failing test pass. The exact `basename: test.name` string to remove is included in the message.","commonSituations":"An esbuild minification/transform improvement lands and a test like `classes.js: issue_4722_1` starts passing. The CI run then fails this assertion until the matching string is deleted from the array at lines 245-270.","solutions":["Copy the `${basename}: ${test.name}` string from the error message.","Delete the matching quoted entry from the known-failure array in scripts/uglify-tests.js (around lines 246-270).","Re-run the uglify test suite to confirm a clean pass."],"exampleFix":"// before (entry still present in known-failure list)\n'classes.js: issue_4722_1',\n'classes.js: issue_4722_2',\n\n// after (remove the now-passing entry)\n'classes.js: issue_4722_2',","handlingStrategy":"validation","validationCode":"// Before committing, locally force the known-failure path off to detect now-passing tests\nprocess.env.CI = ''; // run uglify-tests.js with isExpectingFailure disabled to see what passes\n// Then, with CI set, ensure no entry in the list still passes:\n// (manual: remove any basename:name that no longer fails)","typeGuard":null,"tryCatchPattern":"try { runUglifyTests(); }\ncatch (e) {\n  if (/UPDATE NEEDED: expected failure/.test(e.message)) {\n    const m = e.message.match(/expected failure for ([^:]+): ([^,]+)/);\n    console.log(`Remove '${m[1]}: ${m[2]}' from the known-failure list in scripts/uglify-tests.js`);\n  }\n  throw e;\n}","preventionTips":["After any minification change, run the uglify suite with CI set and prune now-passing entries immediately.","Keep the known-failure list entries as exact `basename: name` strings copied from test files.","Treat this error as a chore, not a regression — it means esbuild improved."],"tags":["test-harness","uglify","test-maintenance","known-failure","ci"],"backgroundTag":null,"analyzedSha":"f6058f8364fe7ab91ca57a83e02577ed74c9cae4","analyzedAt":"2026-08-09T18:37:22.223Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}