{"record":{"id":"021c3622d345b717","repo":"denoland/deno","slug":"err-missing-args-021c36","errorCode":"ERR_MISSING_ARGS","errorMessage":"The \"actual\" and \"expected\" arguments must be specified","messagePattern":"The \"actual\" and \"expected\" arguments must be specified","errorType":"error_code","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/assert.ts","lineNumber":520,"sourceCode":"  ...args\n) {\n  expectsError(throws, getActual(fn), ...new SafeArrayIterator(args));\n}\n\nfunction doesNotThrow(\n  fn,\n  ...args\n) {\n  expectsNoError(doesNotThrow, getActual(fn), ...new SafeArrayIterator(args));\n}\n\nfunction equal(\n  actual,\n  expected,\n  message,\n) {\n  if (arguments.length < 2) {\n    throw new ERR_MISSING_ARGS(\"actual\", \"expected\");\n  }\n\n  if (\n    actual != expected && (!NumberIsNaN(actual) || !NumberIsNaN(expected))\n  ) {\n    innerFail({\n      actual,\n      expected,\n      message,\n      operator: \"==\",\n      stackStartFn: equal,\n      diff: this?.[kOptions]?.diff,\n    });\n  }\n}\n\nfunction notEqual(\n  actual,","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/node/polyfills/assert.ts#L502-L538","documentation":"assert.equal (loose == comparison) requires both actual and expected arguments. The arity guard at the top of the function raises ERR_MISSING_ARGS when fewer than two arguments are supplied, before any comparison happens.","triggerScenarios":"assert.equal(value) with only one argument; assert.equal(undefined) where a config value turned out to be undefined and the expected argument was never written.","commonSituations":"Optional config or environment values that are undefined at runtime; test helpers that forward optional parameters; refactors that removed a parameter but left the assert call intact.","solutions":["Supply both arguments: assert.equal(actual, expected)","Guard the call when the value may be legitimately absent: if (value !== undefined) assert.equal(value, expected)","Fix the data source so the compared value is defined"],"exampleFix":"// before\nassert.equal(config.retryLimit);\n// after\nassert.equal(config.retryLimit, 3);","handlingStrategy":"validation","validationCode":"if (actual === undefined) throw new Error('actual value is missing');\nassert.equal(actual, expected);","typeGuard":null,"tryCatchPattern":"try { assert.equal(a, e); } catch (e) { if (e.code === 'ERR_MISSING_ARGS') throw new Error('supply both actual and expected'); throw e; }","preventionTips":["Pass positional arguments explicitly rather than spreading optional arrays","Presence-check config/env values before asserting on them"],"tags":["assert","testing","arity","node-compat"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}