{"id":"b05a3ec9cf81a51b","repo":"vitest-dev/vitest","slug":"unexpected-value-silent-value-use-silen","errorCode":null,"errorMessage":"Unexpected value \"--silent=${value}\". Use \"--silent=true ${value}\" instead.","messagePattern":"Unexpected value \"--silent=(.+?)\"\\. Use \"--silent=true (.+?)\" instead\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/cli/cli-config.ts","lineNumber":135,"sourceCode":"      }\n      return portOrOptions\n    },\n  },\n  silent: {\n    description: 'Silent console output from tests. Use `\\'passed-only\\'` to see logs from failing tests only.',\n    argument: '[value]',\n    transform(value) {\n      if (value === 'true' || value === 'yes' || value === true) {\n        return true\n      }\n      if (value === 'false' || value === 'no' || value === false) {\n        return false\n      }\n      if (value === 'passed-only') {\n        return value\n      }\n\n      throw new TypeError(`Unexpected value \"--silent=${value}\". Use \"--silent=true ${value}\" instead.`)\n    },\n  },\n  hideSkippedTests: {\n    description: 'Hide logs for skipped tests',\n  },\n  reporter: null,\n  reporters: {\n    alias: 'reporter',\n    description: `Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)`,\n    argument: '<name>',\n    subcommands: null, // don't support custom objects\n    array: true,\n  },\n  outputFile: {\n    argument: '<filename/-s>',\n    description:\n      'Write test results to a file when supporter reporter is also specified, use cac\\'s dot notation for individual outputs of multiple reporters (example: `--outputFile.tap=./tap.txt`)',\n    subcommands: null,","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/cli/cli-config.ts#L117-L153","documentation":"Thrown by the `--silent` option transform when the supplied value is none of the accepted set. The transform accepts true/false/yes/no (booleans) and the literal string 'passed-only' (logs from failing tests only). Any other value is ambiguous and rejected with guidance to combine `--silent=true` with the extra token.","triggerScenarios":"Passing `--silent=quiet`, `--silent=verbose`, `--silent=0/1` (other than the accepted words), or any unrecognized string to `--silent`. The error message itself hints that the user likely meant `--silent=true <value>` where `<value>` was accidentally attached to the flag.","commonSituations":"Confusing `--silent` with a verbosity selector; typos; copying a value from another tool's flag; passing a reporter/filter token that got merged onto --silent by shell quoting.","solutions":["Use one of: `--silent`, `--silent=true`/`--silent=false`/`--silent=yes`/`--silent=no`, or `--silent=passed-only`.","If the unexpected value is a separate CLI token, separate it: `--silent=true <value>` instead of `--silent=<value>`.","Check the flag name spelling and remove trailing tokens merged by the shell."],"exampleFix":"# before\nvitest --silent=quiet\n# after\nvitest --silent=true","handlingStrategy":"validation","validationCode":"const ok = ['true', 'false', 'yes', 'no', 'passed-only', true, false]\nif (!ok.includes(value)) {\n  throw new Error(`invalid --silent value: ${value}`)\n}","typeGuard":"function isSilentValue(v: unknown): v is boolean | 'passed-only' {\n  return [true, false, 'true', 'false', 'yes', 'no', 'passed-only'].includes(v as any)\n}","tryCatchPattern":null,"preventionTips":["Use only the documented --silent values: true/false/yes/no/passed-only.","Keep --silent as a bare flag when you just want silence.","Separate unrelated tokens from the flag in your npm scripts."],"tags":[],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}