{"_id":"jest-prop-type-error","_rev":"2-775acf1fec85af7abdf16443ee98882e","name":"jest-prop-type-error","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"jest-prop-type-error","description":"Makes Jest throw on React prop-type failures","version":"1.0.0","main":"index.js","author":{"name":"Espen Henriksen"},"license":"MIT","homepage":"https://github.com/esphen/jest-prop-type-error","repository":{"type":"git","url":"git+https://github.com/esphen/jest-prop-type-error.git"},"bugs":{"url":"https://github.com/esphen/jest-prop-type-error/issues"},"keywords":["jest","react","test","testing","prop-type","prop-types","error","fail","throw"],"gitHead":"967cdc36cd9a1d64f2c887bc52b48dd4b87c2ea9","_id":"jest-prop-type-error@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"esphen","email":"dev+npmjsorg@henriksen.is"},"dist":{"integrity":"sha512-jmfsZbqsJYkBkWD1ZylY72HqbO6A1gzcuPQ9eOLsEpB+heaBoodbkZtbkWF6T+9/rB06WQa4vjV0tvQczI2fKg==","shasum":"31c7a154c2cb2d3d4a52f9c8ac7abc509c99d6a4","tarball":"https://registry.npmjs.org/jest-prop-type-error/-/jest-prop-type-error-1.0.0.tgz","fileCount":3,"unpackedSize":2244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9GdyCRA9TVsSAnZWagAAhbcQAJ4jfcL91z71bJbfoDk4\nkRP39gWolg1ekWBrNmknnxHAOsyf0VqsMCfWBEKTuAntqq6uSR1Ivqntpksa\n8O/lF/KBABQBMuPjuvn/R4+IWwajZhg/CPasOG9hRXfd/fEuA57ixBCEVbs5\nyDgCYEbCUWiRRK/VPLbgtFX/Pwx6SzIP6dUHZ8jiOswYahKuDya4Rx4LUm37\nqJ/9NjBW7NH4FvhDyeEWIxwVRDB/VlDr2Zwdr19A7J8IOWCIHee+HCKQ+r+y\n2kXa6TwuG7Tb6RS2iekQTzoMTBsnm3og/pd/U3j7NR6NWJQeyR8xy+kOarPg\n8qymoeau25K1aHw2m8K0vHI+uFRtOBXC/zfHZR/Dk9anUA1V7IeojxzBkl4D\njubyvp3LTS4yR5pReggMY6GyVwCfmAawBVJhPgerkQKgpVl7UDnVZSWyNfjb\n+LBWk2L/B1cfKAZbRE5jh17e49/abuk+4LT++GFKQHDLChkg3ExZmACOqIgP\nS0Ex+9Cm9o6iVL1G/n1MWL4BNqUS6ROw4E2U0rXleKh8tm1uePmAdv+jijbz\nEOGkCO7vIDm6MjxysBncfYC0Wot7el4nd2vNu8Z+ndtShH5U6bJANjcuBunf\nCagxNOplnw2D5GRu1K8nsaKm681SuoeelGhvZTilKrYvYTmPFLlmLCLk3hdR\noi/v\r\n=Tv7n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZ6hi5NSwzAEcJlLBym1C7iKSL5rpK1S12gguDxEe0fAiARu1tmw+bM7YgWDFQfAmSu9EE3xspCzbEyJEw+blCFhA=="}]},"maintainers":[{"name":"esphen","email":"dev+npmjsorg@henriksen.is"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-prop-type-error_1.0.0_1525966705237_0.34138716455535056"},"_hasShrinkwrap":false},"1.1.0":{"name":"jest-prop-type-error","description":"Makes Jest throw on React prop-type failures","version":"1.1.0","main":"index.js","author":{"name":"Espen Henriksen"},"license":"MIT","homepage":"https://github.com/esphen/jest-prop-type-error","repository":{"type":"git","url":"git+https://github.com/esphen/jest-prop-type-error.git"},"bugs":{"url":"https://github.com/esphen/jest-prop-type-error/issues"},"keywords":["jest","react","test","testing","prop-type","prop-types","error","fail","throw"],"gitHead":"eda5bd26280527202ef888135373819dc7afb2ce","_id":"jest-prop-type-error@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"esphen","email":"dev+npmjsorg@henriksen.is"},"dist":{"integrity":"sha512-i/4hdbKSp6cFJc2z3Blu2WEOGjxbQ76pShhtDFIqUfdC8ruMGT57EOsBtBq69FVg915MUMwENNc185ejs7mmtg==","shasum":"7949a73cef6b9769ed9811139933b4139d2d8ad9","tarball":"https://registry.npmjs.org/jest-prop-type-error/-/jest-prop-type-error-1.1.0.tgz","fileCount":7,"unpackedSize":8342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9ZteCRA9TVsSAnZWagAAUKUQAJ3eNiF1pWcX5osIXVvS\n9D48EbYAexMa9iqX25NA8xCcUEDCnybIiA1/ZdoSP50oI/7PlLymEc2SSGNr\n7YmInBxctL71W+5nW//v0dxgXH28RMoOBi41MxRAGTt5eaEabNwI3zaOWwXn\nou51g5RgCwVYsRKOel7wFObn4m0wQKjveytd26NNhhCf9vEFMYZ0619rLD06\nrVFyfIvLenQABAZx3oWx8DKaIo7dWLUwjqYp7LEcQhf5qdULtw8f3B4b7mKa\nU+i03wZe5Cw8QT22s1NQhKF/wr/BNJ6LOJlDzcm+xQFCxs8XWdYKtMX/IXFO\njfEU2RCt+1FJIZeqwvayIf8WAkqzfe5GqhsRdt0OfPJqakipw+gN4j0vGwx+\nloOdeiLpsfQJgcwhyVNTGRvu0DqrmW4aPF26QdEH1jXY1G6mcXW8z1uz6m1m\nWKiQPBIFmCCmuyjr9i4LPrtoM0ildGSOnJki+CNVyrKlOzDas91va5Lwn/Es\nK93c+EeGyHisltcrWL49yKFc8OXOkuJsTrWSQoqOtSBOp9RS/YszUogmcoaJ\nBPebC6W+n+/Kj4q5sOBKzLSoSmfShQ9DYa69GZhLSRYG95erelErZqSFYj0s\nBFDWvN8gUifPF40cEs1RlBaZhBz81H8DgLi+oA3LFv47m5TBZirE/uacYGsf\narlX\r\n=Ob8o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBn1BQF/0XHrn9uAR24t3pbvKjn1mqcl3NMmggbqFz8AiEAqxJvEAxclFPRWDHi8WCfEisTk6CDcPDEaSCww8NDT+E="}]},"maintainers":[{"name":"esphen","email":"dev+npmjsorg@henriksen.is"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-prop-type-error_1.1.0_1526045533566_0.35460342313022064"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-10T15:38:25.237Z","1.0.0":"2018-05-10T15:38:25.332Z","modified":"2022-05-06T12:39:15.806Z","1.1.0":"2018-05-11T13:32:13.617Z"},"maintainers":[{"name":"esphen","email":"dev+npmjsorg@henriksen.is"}],"description":"Makes Jest throw on React prop-type failures","homepage":"https://github.com/esphen/jest-prop-type-error","keywords":["jest","react","test","testing","prop-type","prop-types","error","fail","throw"],"repository":{"type":"git","url":"git+https://github.com/esphen/jest-prop-type-error.git"},"author":{"name":"Espen Henriksen"},"bugs":{"url":"https://github.com/esphen/jest-prop-type-error/issues"},"license":"MIT","readme":"# jest-prop-type-error\n\n> Improves prop-types support in Jest by failing tests on prop-type errors\n> instead of ignoring them\n\n[prop-types][pt] is a library from Facebook that makes it easy to verify that\nthe props passed to a [React][react] component is of the correct type. However,\nit only allows us runtime type checking, which means some failures can slip by\ninto production.\n\nThis is possible to solve with [Jest][jest] by making prop-type errors throw\ninstead of only logging a warning. In this case your tests would run and\nwhenever a wrong prop is passed to a component, the prop-type validation would\npick this up and fail the test. Then we would be able to verify that the props\nthat are passed to our components are good compile-time, provided the tests\nrun when we build our production bundle.\n\nThat is what this library does!\n\n[Read this blog][blog] for a more in-depth explanation.\n\n# Install\n\n    yarn add -D jest-prop-type-error\n\n# Usage\n\nIn order to enable us to detect prop-type errors and fail the test, you need to\nadd the following to your `package.json`'s jest section.\n\n      \"setupFiles\": [\n        \"jest-prop-type-error\"\n      ]\n\nIf there is no jest section in your `package.json`, add one and use that.\n\nNow simply run your tests like usual, and prop-type errors will throw instead\nof logging a warning!\n\n# Acknowledgments\n\nThanks to [Stian Didriksen][stian] for the idea in his talk about Jest at the\nReactJS Oslo Meetup 9th May 2018.\n\n[pt]: https://facebook.github.io/react/docs/typechecking-with-proptypes.html\n[blog]: https://medium.com/shark-bytes/type-checking-with-prop-types-in-jest-e0cd0dc92d5\n[react]: https://reactjs.org/\n[jest]: https://facebook.github.io/jest/\n[stian]: https://twitter.com/stipsan\n","readmeFilename":"README.md"}