{"_id":"@alex_neo/jest-expect-message","_rev":"2-124df5fad1e2de3ac8341cca4e64ce2e","name":"@alex_neo/jest-expect-message","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.4":{"name":"@alex_neo/jest-expect-message","version":"1.0.4","description":"Add custom message to Jest expects","main":"dist/index.js","scripts":{"build":"babel src -d dist --ignore *.test.js","contributor":"all-contributors add","contributor:gen":"all-contributors generate","lint":"eslint src","lint:fix":"yarn lint --fix","precommit":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier 'src/**/*.js' --write --single-quote=true --print-width=120","test":"jest","test:coverage":"yarn test --coverage","test:report":"codecov"},"keywords":["jest","expect","message","matchers","assertions","test"],"author":{"name":"Matt Phillips","email":"matt@mattphillips.io"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mattphillips/jest-expect-message.git"},"bugs":{"url":"https://github.com/mattphillips/jest-expect-message/issues"},"homepage":"https://github.com/mattphillips/jest-expect-message#readme","devDependencies":{"all-contributors-cli":"^5.4.0","babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-eslint":"^8.2.6","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","codecov":"^3.0.4","eslint":"^5.3.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jest":"^21.18.0","husky":"^0.14.3","jest":"^23.4.2","jest-extended":"^0.8.1","lint-staged":"^7.2.0","prettier":"^1.14.0"},"lint-staged":{"*.js":["yarn prettier","git add"]},"babel":{"plugins":["transform-es2015-modules-commonjs","transform-object-rest-spread"]},"jest":{"testEnvironment":"node","setupTestFrameworkScriptFile":"jest-extended"},"gitHead":"490dd0e22a2552a130c91de10de48bd1a34354e6","_id":"@alex_neo/jest-expect-message@1.0.4","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-CCiMKnBRd1Pk8A4igntZe1UbBHaW6rCvGELY94JDwvxmm80ToNmXfnPZiHm5r0PPrYuTqE2ait+C8TTb3xRiug==","shasum":"8e3a2a027f0881e00b36f40b296e8f4ff2473831","tarball":"https://registry.npmjs.org/@alex_neo/jest-expect-message/-/jest-expect-message-1.0.4.tgz","fileCount":19,"unpackedSize":24554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0Yl1CRA9TVsSAnZWagAAdh8QAKCCtTE4myjPq/vUm9DJ\nZyI9hUSSf3GaixeZsUihlPZptpGdpmJtKht2irLHSsyxyAYK5GHT64leAZa+\nRLb+1B5uUXwbz+lXtXJvrZOPGnGpOBhHBKMDNeY2889EiKBxyUYJnjnSVoUR\nSoeQjzqNt7Z0KL/WDwOnIVjyUqwka629SS3AKKvl24TKPW3J+sr8Kj88w353\nO65gH2WCiRCiIRK+lI5osdPNg1vTU/SxtNzizAPFFP8N/pWBvOf0GxKkDGyK\ne666WHRsqA8E9bF8IkQZt+SKW2FmHrzLrCjxRn5Ummt3tRAfS+b4XiJAwaJY\nLlmsRjivWmMs405RgNjcIuBFzS9R/0pZREPTnfYaxFfZRqFu18029PJNVsct\n9ugGT9yFRyWdIDXpNsX/i3jvkuMBuJcKa2pSOvrXwdQu6y89Urogg3095TjB\npQw2rTb5JsvadQm3ekYGEvcjeMWPq9vxJ5mUupFTJ2rfpnNNqEll3ju367sG\nUk1d5rR5JMHWFsMIbvleXXcdPvVtH/mjGb246pPpkoifmXRyALEEIhf2f6wd\nsCTGOmf1sO3SNsky400aMwNp3AHTBTIsZNi+7+7dnx5MYW8AAGvAON8a9iwR\nIjp1rbQVmKffLIhrRyW113X1RBPWxWdsjc9s8CRZkuHCylyXAxJeW3MhdH5h\na9jx\r\n=risu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+FEAKRPuJV9O4l9MCRCfaDSIoagj5ZWp0bi3PofL7IAiAzzmCeX9Tp8MnT4o2Pf7ggWfco5ZuMhDt3dj2AP5m2rg=="}]},"_npmUser":{"name":"alex_neo","email":"alexneo2003@gmail.com"},"directories":{},"maintainers":[{"name":"alex_neo","email":"alexneo2003@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-expect-message_1.0.4_1624344948788_0.6251343352770533"},"_hasShrinkwrap":false},"1.0.5":{"name":"@alex_neo/jest-expect-message","version":"1.0.5","description":"Add custom message to Jest expects","main":"dist/index.js","scripts":{"build":"babel src -d dist --ignore *.test.js","contributor":"all-contributors add","contributor:gen":"all-contributors generate","lint":"eslint src","lint:fix":"yarn lint --fix","precommit":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier 'src/**/*.js' --write --single-quote=true --print-width=120","test":"jest","test:coverage":"yarn test --coverage","test:report":"codecov"},"keywords":["jest","expect","message","matchers","assertions","test"],"author":{"name":"Matt Phillips","email":"matt@mattphillips.io"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mattphillips/jest-expect-message.git"},"bugs":{"url":"https://github.com/mattphillips/jest-expect-message/issues"},"homepage":"https://github.com/mattphillips/jest-expect-message#readme","devDependencies":{"all-contributors-cli":"^5.4.0","babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-eslint":"^8.2.6","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","codecov":"^3.0.4","eslint":"^5.3.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jest":"^21.18.0","husky":"^0.14.3","jest":"^23.4.2","jest-extended":"^0.8.1","lint-staged":"^7.2.0","prettier":"^1.14.0"},"lint-staged":{"*.js":["yarn prettier","git add"]},"babel":{"plugins":["transform-es2015-modules-commonjs","transform-object-rest-spread"]},"jest":{"testEnvironment":"node","setupTestFrameworkScriptFile":"jest-extended"},"gitHead":"5055a55c5dcda7f4e290337798dc9903806cee7e","_id":"@alex_neo/jest-expect-message@1.0.5","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1eBykZCd0pPGl5qKtV6Z5ARA6yuhXzHsVN2h5GH5/H6svYa37Jr7vMio5OFpiw1LBHtscrZs7amSkZkcwm0cvQ==","shasum":"bdc96f5764cb42ab677941c1ac86b2e4bea96fa7","tarball":"https://registry.npmjs.org/@alex_neo/jest-expect-message/-/jest-expect-message-1.0.5.tgz","fileCount":19,"unpackedSize":25023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0YoBCRA9TVsSAnZWagAARcQP/02+IfNDVykEFY+s9AYC\nwFloZth++QxeSwoog/5s9AvW7vvnCj1W6xx1VmBTIkagcHeXbiKVUruBWP+L\nz/goEvSCWMnkY/UsO+5J9aiW8Z7VY/G48o+lSsCDQV3ydAhQHK1IiZG4Be1r\ndQrpn68AsVzGzEO3JIyTr20u7vPxDgupvnbNj8mAWs15A6fWHy8gW5mNo+L7\nUUUQUkcUyv+1NdLJD1Se9Ip/KS89eakjSKt1/UFjyawPt4WOoEpyfLrjGFYN\ndzCdS8qTxegBZj1DOON1fT0mn7lBbFCZi3PTjcQlqfOzs6RWaOMD5Uc2n3v1\noqNNPMjMzUSOI9GF+o5ykcvse2eMTXjMM5vpY3NrGsA/N9yarBuOy7F12O6s\nlKGhZ4Xfv8ioCDoZET8UvbYnoPdwfjJHKAce4D6VvOwi9hkuChDARcX9S7k9\nlMekCsxxf6rBiv6o60QMKMZ0PSbl6TTMJnPc0nzx4dMcV5hh1PoSGaJlG2qt\n4Qyu1C9/Kk3a9zX0gobRTySqHt3PEgRxEwwZWpjbBmoHAecYWqlL43fmuO3f\ntTS9+e5H8hFRUUl5zZ5hxtdw4T0gLkKB4/HO4xNT6CKVWto9XIwMq/0zAkkF\nh5rMd8KH5/GSwqVQM48XrEwGllIwANX0y1oDzbxHHy7fNEt73bBUeG737ddq\n6hPt\r\n=GtWn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvcFPvGsFH3Jy+If7M2l6pPSbcZxvgG5g1a/Gwbkn4jgIhAJVB+5HtrAJwL5xZk9xq9dfZ8plXb7E/LvZVSquoT+rd"}]},"_npmUser":{"name":"alex_neo","email":"alexneo2003@gmail.com"},"directories":{},"maintainers":[{"name":"alex_neo","email":"alexneo2003@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-expect-message_1.0.5_1624345089250_0.7544255634843993"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-22T06:55:48.750Z","1.0.4":"2021-06-22T06:55:48.932Z","modified":"2022-04-04T12:38:39.483Z","1.0.5":"2021-06-22T06:58:09.410Z"},"maintainers":[{"name":"alex_neo","email":"alexneo2003@gmail.com"}],"description":"Add custom message to Jest expects","homepage":"https://github.com/mattphillips/jest-expect-message#readme","keywords":["jest","expect","message","matchers","assertions","test"],"repository":{"type":"git","url":"git+https://github.com/mattphillips/jest-expect-message.git"},"author":{"name":"Matt Phillips","email":"matt@mattphillips.io"},"bugs":{"url":"https://github.com/mattphillips/jest-expect-message/issues"},"license":"MIT","readme":"<div align=\"center\">\r\n<h1>jest-expect-message</h1>\r\n\r\n🃏🗯\r\n\r\nAdd custom message to Jest expects\r\n</div>\r\n\r\n<hr />\r\n\r\n[![Build Status](https://img.shields.io/travis/mattphillips/jest-expect-message.svg?style=flat-square)](https://travis-ci.org/mattphillips/jest-expect-message)\r\n[![Code Coverage](https://img.shields.io/codecov/c/github/mattphillips/jest-expect-message.svg?style=flat-square)](https://codecov.io/github/mattphillips/jest-expect-message)\r\n[![version](https://img.shields.io/npm/v/jest-expect-message.svg?style=flat-square)](https://www.npmjs.com/package/jest-expect-message)\r\n[![downloads](https://img.shields.io/npm/dm/jest-expect-message.svg?style=flat-square)](http://npm-stat.com/charts.html?package=jest-expect-message&from=2017-09-14)\r\n[![MIT License](https://img.shields.io/npm/l/jest-expect-message.svg?style=flat-square)](https://github.com/mattphillips/jest-expect-message/blob/master/LICENSE)\r\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\r\n[![Roadmap](https://img.shields.io/badge/%F0%9F%93%94-roadmap-CD9523.svg?style=flat-square)](https://github.com/mattphillips/jest-expect-message/blob/master/docs/ROADMAP.md)\r\n[![Examples](https://img.shields.io/badge/%F0%9F%92%A1-examples-ff615b.svg?style=flat-square)](https://github.com/mattphillips/jest-expect-message/blob/master/docs/EXAMPLES.md)\r\n\r\n## Problem\r\n\r\nIn many testing libraries it is possible to supply a custom message for a given expectation, this is currently not\r\npossible in Jest.\r\n\r\nFor example:\r\n\r\n```js\r\ntest('returns 2 when adding 1 and 1', () => {\r\n  expect(1 + 1, 'Woah this should be 2!').toBe(3);\r\n});\r\n```\r\n\r\nThis will throw the following error in Jest:\r\n\r\n```sh\r\nExpect takes at most one argument.\r\n```\r\n\r\n## Solution\r\n\r\n`jest-expect-message` allows you to call `expect` with a second argument of a `String` message.\r\n\r\nFor example the same test as above:\r\n\r\n```js\r\ntest('returns 2 when adding 1 and 1', () => {\r\n  expect(1 + 1, 'Woah this should be 2!').toBe(3);\r\n});\r\n```\r\n\r\nWith `jest-expect-message` this will fail with your custom error message:\r\n\r\n```sh\r\n  ● returns 2 when adding 1 and 1\r\n\r\n    Custom message:\r\n      Woah this should be 2!\r\n\r\n    expect(received).toBe(expected) // Object.is equality\r\n\r\n    Expected: 3\r\n    Received: 2\r\n```\r\n\r\n## Installation\r\n\r\nWith npm:\r\n```sh\r\nnpm install --save-dev jest-expect-message\r\n```\r\n\r\nWith yarn:\r\n```sh\r\nyarn add -D jest-expect-message\r\n```\r\n\r\n## Setup\r\n\r\nAdd `jest-expect-message` to your Jest `setupFilesAfterEnv` configuration.\r\n[See for help](https://jestjs.io/docs/en/next/configuration#setupfilesafterenv-array)\r\n\r\n### Jest v24+\r\n\r\n```json\r\n\"jest\": {\r\n  \"setupFilesAfterEnv\": [\"jest-expect-message\"]\r\n}\r\n```\r\n\r\n### Jest v23-\r\n\r\n```json\r\n\"jest\": {\r\n  \"setupTestFrameworkScriptFile\": \"jest-expect-message\"\r\n}\r\n```\r\n\r\n## Usage\r\n\r\n - `expect(actual, message)`\r\n   - `actual`: The value you would normally pass into an `expect` to assert against with a given matcher.\r\n   - `message`: String, the custom message you want to be printed should the `expect` fail.\r\n\r\n```js\r\ntest('returns 2 when adding 1 and 1', () => {\r\n  expect(1 + 1, 'Woah this should be 2!').toBe(3);\r\n});\r\n```\r\n\r\n## Contributors\r\n\r\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore -->\n| [<img src=\"https://avatars0.githubusercontent.com/u/5610087?v=4\" width=\"100px;\"/><br /><sub><b>Matt Phillips</b></sub>](http://mattphillips.io)<br />[💻](https://github.com/mattphillips/jest-expect-message/commits?author=mattphillips \"Code\") [📖](https://github.com/mattphillips/jest-expect-message/commits?author=mattphillips \"Documentation\") [💡](#example-mattphillips \"Examples\") [🤔](#ideas-mattphillips \"Ideas, Planning, & Feedback\") [🚇](#infra-mattphillips \"Infrastructure (Hosting, Build-Tools, etc)\") [⚠️](https://github.com/mattphillips/jest-expect-message/commits?author=mattphillips \"Tests\") [🔧](#tool-mattphillips \"Tools\") | [<img src=\"https://avatars.githubusercontent.com/u/11705902?v=4\" width=\"100px;\"/><br /><sub><b>Alex Neo</b></sub>](https://github.com/alexneo2003)<br />[💻](https://github.com/mattphillips/jest-expect-message/commits?author=alexneo2003 \"Code\") |\n| :---: | :---: |\n<!-- ALL-CONTRIBUTORS-LIST:END -->\r\n\r\n## LICENSE\r\n\r\n[MIT](/LICENSE)\r\n\r\n","readmeFilename":"README.md"}