{"id":"433977f49c84bb6d","repo":"jestjs/jest","slug":"pretty-format-unknown-option-key","errorCode":null,"errorMessage":"pretty-format: Unknown option \"${key}\".","messagePattern":"pretty-format: Unknown option \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/pretty-format/src/index.ts","lineNumber":426,"sourceCode":"  callToJSON: true,\n  compareKeys: undefined,\n  escapeRegex: false,\n  escapeString: true,\n  highlight: false,\n  indent: 2,\n  maxDepth: Number.POSITIVE_INFINITY,\n  maxWidth: Number.POSITIVE_INFINITY,\n  min: false,\n  plugins: [],\n  printBasicPrototype: true,\n  printFunctionName: true,\n  theme: DEFAULT_THEME,\n});\n\nfunction validateOptions(options: OptionsReceived) {\n  for (const key of Object.keys(options)) {\n    if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key)) {\n      throw new Error(`pretty-format: Unknown option \"${key}\".`);\n    }\n  }\n\n  if (options.min && options.indent !== undefined && options.indent !== 0) {\n    throw new Error(\n      'pretty-format: Options \"min\" and \"indent\" cannot be used together.',\n    );\n  }\n\n  if (options.theme !== undefined) {\n    if (options.theme === null) {\n      throw new Error('pretty-format: Option \"theme\" must not be null.');\n    }\n\n    if (typeof options.theme !== 'object') {\n      throw new TypeError(\n        `pretty-format: Option \"theme\" must be of type \"object\" but instead received \"${typeof options.theme}\".`,\n      );","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/jestjs/jest/blob/f49721c78e195558b40913977c9230f5b7f559d8/packages/pretty-format/src/index.ts#L408-L444","documentation":"Error \"pretty-format: Unknown option \"${key}\".\" thrown in jestjs/jest.","triggerScenarios":"Thrown at packages/pretty-format/src/index.ts:426 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or correct the unknown option passed to pretty-format. Check the pretty-format documentation for the list of supported options (e.g. callToJSON, maxDepth, min, plugins, printFunctionName, theme)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"f49721c78e195558b40913977c9230f5b7f559d8","analyzedAt":"2026-08-03T20:16:28.571Z","schemaVersion":2}