{"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"}],"dist-tags":{"latest":"19.0.2","canary":"18.5.0-alpha.7da3df39","next":"19.1.0-alpha.eed82034"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","readme":"# jest-validate\n\nGeneric configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.\n\n```\nnpm install --save jest-validate\n```\n\n## Usage\n\n```js\nimport {validate} from 'jest-validate';\n\nvalidate(\n  config: Object,\n  options: ValidationOptions,\n);\n```\n\nWhere `ValidationOptions` are:\n```js\ntype ValidationOptions = {\n  comment?: string,\n  condition?: (option: any, validOption: any) => boolean,\n  deprecate?: (\n    config: Object,\n    option: string,\n    deprecatedOptions: Object,\n    options: ValidationOptions\n  ) => void,\n  deprecatedConfig?: {[key: string]: Function},\n  error?: (\n    option: string,\n    received: any,\n    defaultValue: any,\n    options: ValidationOptions,\n  ) => void,\n  exampleConfig: Object,\n  title?: Title,\n  unknown?: (\n    config: Object,\n    exampleConfig: Object,\n    option: string,\n    options: ValidationOptions\n  ) => void,\n}\n\ntype Title = {|\n  deprecation?: string,\n  error?: string,\n  warning?: string,\n|}\n```\n\n`exampleConfig` is the only option required.\n\n## API\n\nBy default `jest-validate` will print generic warning and error messages. You can however customize this behavior by providing `options: ValidationOptions` object as a second argument:\n\nAlmost anything can be overwritten to suite your needs.\n\n### Options\n\n* `comment` – optional string to be rendered bellow error/warning message.\n* `condition` – an optional function with validation condition.\n* `deprecate`, `error`, `unknown` – optional functions responsible for displaying warning and error messages.\n* `deprecatedConfig` – optional object with deprecated config keys.\n* `exampleConfig` – the only **required** option with configuration against which you'd like to test.\n* `title` – optional object of titles for errors and messages.\n\nYou will find examples of `condition`, `deprecate`, `error`, `unknown`, and `deprecatedConfig` inside source of this repository, named respectively.\n\n## Examples\n\nMinimal example:\n\n```js\nvalidate(config, {exampleConfig});\n```\n\nExample with slight modifications:\n\n```js\nvalidate(config, {\n  comment: '  Documentation: http://custom-docs.com',\n  exampleConfig,\n  deprecatedConfig,\n  title: {\n    deprecation: 'Custom Deprecation',\n    // leaving 'error' and 'warning' as default\n  }\n});\n```\n\nThis will output:\n\n#### Warning:\n\n```\n● Validation Warning:\n\n  Unknown option transformx with value \"<rootDir>/node_modules/babel-jest\" was found.\n  This is either a typing error or a user mistake. Fixing it will remove this message.\n\n  Documentation: http://custom-docs.com\n```\n\n#### Error:\n\n```\n● Validation Error:\n\n  Option transform must be of type:\n    object\n  but instead received:\n    string\n\n  Example:\n  {\n    \"transform\": {\"^.+\\\\.js$\": \"<rootDir>/preprocessor.js\"}\n  }\n\n  Documentation: http://custom-docs.com\n```\n\n#### Deprecation\nBased on `deprecatedConfig` object with proper deprecation messages. Note custom title:\n\n```\nCustom Deprecation:\n\n  Option scriptPreprocessor was replaced by transform, which support multiple preprocessors.\n\n  Jest now treats your current configuration as:\n  {\n    \"transform\": {\".*\": \"xxx\"}\n  }\n\n  Please update your configuration.\n\n  Documentation: http://custom-docs.com\n```\n","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"bugs":{"url":"https://github.com/facebook/jest/issues"},"license":"BSD-3-Clause","versions":{"0.0.0":{"name":"jest-validate","version":"0.0.0","_id":"jest-validate@0.0.0","scripts":{},"_shasum":"fd6a81d24c202ede7adb4e5f8264a8d043721199","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"fd6a81d24c202ede7adb4e5f8264a8d043721199","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-0.0.0.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/jest-validate-0.0.0.tgz_1483913538876_0.5495937410742044"},"directories":{}},"18.1.0":{"name":"jest-validate","version":"18.1.0","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.1","jest-matcher-utils":"^18.1.0","pretty-format":"^18.1.0"},"devDependencies":{"jest-config":"^18.1.0"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@18.1.0","scripts":{},"_shasum":"014792ccdb97801db475da0ad42076d94fba301a","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"014792ccdb97801db475da0ad42076d94fba301a","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-18.1.0.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kentaromiura","email":"kentaromiura@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/jest-validate-18.1.0.tgz_1484606081646_0.19497433700598776"},"directories":{}},"18.2.0":{"name":"jest-validate","version":"18.2.0","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.1","jest-matcher-utils":"^18.1.0","leven":"^2.0.0","pretty-format":"^18.1.0"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@18.2.0","scripts":{},"_shasum":"01f93ac78f23901cf9889808e2bbb931ffc58d86","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"01f93ac78f23901cf9889808e2bbb931ffc58d86","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-18.2.0.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kentaromiura","email":"kentaromiura@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/jest-validate-18.2.0.tgz_1484826359154_0.7840725944843143"},"directories":{}},"18.5.0-alpha.7da3df39":{"name":"jest-validate","version":"18.5.0-alpha.7da3df39","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.1","jest-matcher-utils":"^18.5.0-alpha.7da3df39","leven":"^2.0.0","pretty-format":"^18.5.0-alpha.7da3df39"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@18.5.0-alpha.7da3df39","scripts":{},"_shasum":"b328bd51095dcc57c53a715656e366756a65003c","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"b328bd51095dcc57c53a715656e366756a65003c","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-18.5.0-alpha.7da3df39.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kentaromiura","email":"kentaromiura@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/jest-validate-18.5.0-alpha.7da3df39.tgz_1487350674458_0.6208366225473583"},"directories":{}},"19.0.0":{"name":"jest-validate","version":"19.0.0","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.1","jest-matcher-utils":"^19.0.0","leven":"^2.0.0","pretty-format":"^19.0.0"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@19.0.0","scripts":{},"_shasum":"8c6318a20ecfeaba0ba5378bfbb8277abded4173","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"8c6318a20ecfeaba0ba5378bfbb8277abded4173","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-19.0.0.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kentaromiura","email":"kentaromiura@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/jest-validate-19.0.0.tgz_1487669429811_0.019426088547334075"},"directories":{}},"19.0.2":{"name":"jest-validate","version":"19.0.2","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.1","jest-matcher-utils":"^19.0.0","leven":"^2.0.0","pretty-format":"^19.0.0"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@19.0.2","scripts":{},"_shasum":"dc534df5f1278d5b63df32b14241d4dbf7244c0c","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"dc534df5f1278d5b63df32b14241d4dbf7244c0c","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-19.0.2.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"kentaromiura","email":"kentaromiura@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/jest-validate-19.0.2.tgz_1487849790794_0.19821654679253697"},"directories":{}},"19.1.0-alpha.eed82034":{"name":"jest-validate","version":"19.1.0-alpha.eed82034","repository":{"type":"git","url":"git+https://github.com/facebook/jest.git"},"license":"BSD-3-Clause","main":"build/index.js","dependencies":{"chalk":"^1.1.3","jest-matcher-utils":"^19.1.0-alpha.eed82034","leven":"^2.1.0","pretty-format":"^19.1.0-alpha.eed82034"},"description":"Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.","bugs":{"url":"https://github.com/facebook/jest/issues"},"homepage":"https://github.com/facebook/jest#readme","_id":"jest-validate@19.1.0-alpha.eed82034","scripts":{},"_shasum":"0a7c101a92ba5e380f4a00155a9ea95965f2a541","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"cpojer","email":"christoph.pojer@gmail.com"},"dist":{"shasum":"0a7c101a92ba5e380f4a00155a9ea95965f2a541","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/jest-validate/-/jest-validate-19.1.0-alpha.eed82034.tgz"},"maintainers":[{"name":"cpojer","email":"christoph.pojer@gmail.com"},{"name":"dmitriiabramov","email":"dmitrii@rheia.us"},{"name":"fb","email":"opensource+npm@fb.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/jest-validate-19.1.0-alpha.eed82034.tgz_1489711291128_0.35937419976107776"},"directories":{}}},"name":"jest-validate","time":{"modified":"2017-03-17T00:44:14.165Z","created":"2017-01-08T22:12:19.553Z","0.0.0":"2017-01-08T22:12:19.553Z","18.1.0":"2017-01-16T22:34:43.404Z","18.2.0":"2017-01-19T11:46:00.969Z","18.5.0-alpha.7da3df39":"2017-02-17T16:57:55.071Z","19.0.0":"2017-02-21T09:30:31.651Z","19.0.2":"2017-02-23T11:36:31.481Z","19.1.0-alpha.eed82034":"2017-03-17T00:41:34.559Z"},"readmeFilename":"README.md","homepage":"https://github.com/facebook/jest#readme"}