{"_id":"jest-tobetype","_rev":"8-d0b2232b246b73e08c3be177ab9054c8","name":"jest-tobetype","description":"A jest matcher that allows you to test the expected type of a value","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.0":{"name":"jest-tobetype","version":"1.0.0","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^21.2.1"},"gitHead":"78c211253b2ff2923f24a112c37fc775094197d8","_id":"jest-tobetype@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.0.0","_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"dist":{"integrity":"sha512-PW7pPyV9yljmpx8ztghqA26kSNE+ra//Kg0WOX0VGkszpqzjzzuNcDpgAuusYbDRTYYxkiIv0AEVqALHAlmXqA==","shasum":"2e8b15fc7908b61de85ce7b1edaa2e0b0e6bdade","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX1bm3FANehTZ3bojCCRWh8eBqTxYFovYuMPO0NwHGLAiBEeQ3bXI9XWdbtAS2gnLpKARfNXdsICnc2NdvnwRPVRw=="}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype-1.0.0.tgz_1507327002194_0.8659445012453943"},"directories":{}},"1.1.0":{"name":"jest-tobetype","version":"1.1.0","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^21.2.1"},"dependencies":{"jest-matcher-utils":"^21.2.1","jest-get-type":"^21.2.0"},"gitHead":"7fa982ed112182727712622a8509f437cf5c1177","_id":"jest-tobetype@1.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.0.0","_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"dist":{"integrity":"sha512-vKgvzKaRiZgrOgyNijFFHONmK2TKVl9OvtujBECJJ0KLYIyKGevc9UVl33jI6PejEDXNT2e+OgujyoXFd8aE4A==","shasum":"85af0d8ab7252399a41588e0ec16d299deef9c9a","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+gtcYqYAZ7mwNyITVP6lLW+b9OvMpXxoP1501LKyV0wIgdRrBspMYJhN5xH8/IaUOW3CajsZOUTuA+JOjivgCNxM="}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype-1.1.0.tgz_1507660996615_0.2663340694271028"},"directories":{}},"1.2.0":{"name":"jest-tobetype","version":"1.2.0","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^21.2.1"},"dependencies":{"jest-get-type":"^22.3.3","jest-matcher-utils":"^23.6.0"},"gitHead":"160005c4c5a752aeaa25e115ee8edccccbd5978f","_id":"jest-tobetype@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"dist":{"integrity":"sha512-f3FylAnz07t0secibwBq8n8P2XIUYdfjw9sOGqnYdytRysFl4nrD+mDcK/mJsmHVsf2YBm891m5ZE8fkO0Sp8g==","shasum":"3bab33d22603e2774428a435ad835629917b230d","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.2.0.tgz","fileCount":5,"unpackedSize":5649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbo/i0CRA9TVsSAnZWagAARJcP/3tDE+XImbn9sqDFSxyY\nszDKF+ZuW4ISork9LYjz6YyZYurw1bdfKRM50TVYAe6z1lPDHEe3PCdwXnOV\nLipK0SHwY8rQGsYT3pLCmLxcSuy0wn3RliZD9AvAvjeDwBbuGQgXBMUE+F/n\nvOG4qbQ9yxSM6REL5gcc9zKaj7FqGfgFlx2lAyWotMHRVv+jZ6arv9eBUXIp\nYKxoVLB5eFiaqPHuKKKMSWRRVF3FN6ViWh/NoM7Jdw0drR9fDfGpGdFlN4OS\nsjYn8+UwLg6ae7KW8eJg19BgbyeZabRJ32IKR8Ov9qA9O0pAxnquTkthEg0Y\n6tP0PqUyCOlszbjeFctZTgAqaVZaN0EHbuIPi/Wc82+vnra4rWNQpm4tzAdY\nM2U/t9fN5ih03DOKxOMpAKYXVKH7WZXVR7lGKiD9Fd+AZ3PGf9gswvuDL5fa\no8C36LvvVe9nlAqv5IbpO6ZoijREdBQJc/rehGC/iWKjUBDwJ9IBO6cYdq5e\nDKuo8zbY0d1euersT4dIftaKmqVljCMR0ZSLjcc8+nVwpNVruWhJuf2Bp5j7\nokpqBVxm/4H+etPxhgRO3s9+WdcV1vpDpaIS96fdUkEhl3x4ix6EvHl5tBnN\nk/A2haxFOa/Ajn8qYH7TCGQSxb5pC4TqIfKbpb8v1QI39Kjag1eY8wEJhR4A\npdBw\r\n=2Air\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGU/vzaonRowmW1q8nwOwq70EIJaU6L0pYm+TG/iAvUzAiEAmce6G86ImJXyVO+1qwd121PTa4KOW/fX4SvVCwbTTmA="}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype_1.2.0_1537472691574_0.8104730622306853"},"_hasShrinkwrap":false},"1.2.1":{"name":"jest-tobetype","version":"1.2.1","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^24.0.0"},"dependencies":{"jest-get-type":"^24.0.0","jest-matcher-utils":"^24.0.0"},"gitHead":"04d2cbb2a3a2c767801bae8a4a51e4c173fabcac","_id":"jest-tobetype@1.2.1","_npmVersion":"6.5.0","_nodeVersion":"10.12.0","_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"dist":{"integrity":"sha512-H/76RVpdg+3rcm52Ua4XpIQDGyAdipOrtnwZDWemmmluazchhGfjSLT2Z5TE2MwgSRzNuskb1/TCjYrVsSMwSA==","shasum":"53bcfd8da74009cb075a2b132a11c1fa0ad38733","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.2.1.tgz","fileCount":5,"unpackedSize":5649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW3TjCRA9TVsSAnZWagAAilsP/RkYPEx3cWfQW/h6B0NF\nUi6vM0a3cgbPt5D5wjkmWlMcYolg9DsXOcxvIrtEJ2RDWSkkEmwuu5kRTjGi\n7iQwArrJDAwT3ZJQESpJJiyV5DqT12veI5MgMeY+PQLloMseKGHjfOuFBySA\nhpbUMRUF+g9buiwP9/aJwK6yL24FbpgkOnC1J7SE/WBRDoLz/Nj35s0FGcl4\nJIhL5XU7fjnocGr3jj65+r1O/1O4g9S6S2qp8UNW+RkKN0ZwbPy81feAtTtb\n3+GJ79OKadcwg7dgRvUcnRfriFbY9WndOT++moYyVOJYSAEyMSJWFs3CN+Zt\nRqpRsTwTDAsYppUTFnzPXR/hhTTf9ImiSoboYmludkUSsbYAzA0lGstVnAdO\nF5gB8Pi0fFLbk47KjtHhU5qXK4jluZpyLdi/g8EO9Ov1FQgqHbap/Z8FDW/m\ny+CL3GMqlo0/0goMk0NDrwpOHnrNEj6/aAQjAmFMFFZEtgZIwGlmB2YNzGPc\nk4DZW+En4BR1NMP18S20mqa3Jh2kBABvwTDSOr8WgTzldDOZ+cx+lU77KNLi\nOA2CgNCHWJZAmJKtjqCdmCkLj9Zvyt8iTWDCZR1llfb9SGcFW+2/HxfHO75h\nLjgKGJbzslRPErIYAtCM5m8b8kBcNOxEgeOxtNZZlHT9a+VSoZgYrhWhFjRq\nwIKS\r\n=5sHm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVqvCXtqaOB5bcvyWcObY3BlVe9mk84Lj0MdNSwEw+JwIhAL8STyD0bzg3plHGTJXCmM9cXwrqjSBaLTNOL1CNCXRy"}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype_1.2.1_1549497571114_0.002982178034198979"},"_hasShrinkwrap":false},"1.2.2":{"name":"jest-tobetype","version":"1.2.2","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^24.0.0"},"dependencies":{"jest-get-type":"^24.0.0","jest-matcher-utils":"^24.0.0"},"gitHead":"8f74007cd9ec17e43e25cde7f0ec139ddee06a8a","_id":"jest-tobetype@1.2.2","_npmVersion":"6.5.0","_nodeVersion":"10.12.0","_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"dist":{"integrity":"sha512-qG49i9MKq53uKvA8iWUP3aAkOt9pVOKKOxKogYWqwHBwvHYZBfqKFYNgG8ZV9oTGa7HrNFPJCuceaue1QUXGNw==","shasum":"01a4cc97a6391f4a24dbd53ec841843404decc43","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.2.2.tgz","fileCount":5,"unpackedSize":5647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcW3aICRA9TVsSAnZWagAALl8P/Rg6mWa6vZAF/rTI42SW\nMgK6bBa8SZvjQ5vUkFa0g+hp8zZ8UT7JrEUzgX8wkCgqNM/9mSnA+h2NrhBH\nnSc5YtgUrmRNqZ5X2f0vp7f8LQ4+A7vw4LoUhRXefptaNQzUvPBO9pSPUgND\n537/z2zCrreIOP9aK7wu1nz6A1gcsrS6ICkOYJfb7Sqe5w3M4xdCdBcvmvTA\nijTJktPOCVI5ly/fnYfZDBXWj1y8I+uIzCzY9K8nC1S0u03XwtO+6hRtbX+8\n7m42BSxrrH8Dy2u7AuJ1tqZr3Vi1pmtz8jRcVxY/jmDBlD3RKvUAv/bFGhnq\nqxwucB/C91wf/rrEkk22SsadeqAdSQPOLdEnFS3MhjIVdNnT2fTTdI8+X9nq\nPd1wJU2qVr10M8ufzyeySCtC1l1MJv1YKC+9qPweAIJNGHuMQhuvYyQZofPt\ngRe4T5y8YW+CDeclQauLLsEMabNUWfyVNUN/l6XeeFj5fnysSM+DJgczgBed\nx7VwXKSzpbJQZ3z1+A5UDDYgXEW4pltxP5rmekIoiRBPtX94nYUe5rzHZVV3\np635GOdyAtwCU716X9orGFfiJVFXTsyBqVz32VYNkgcAT6oHyjKV91kVuSjZ\nWQ/npL4G1qZBGTYkYn4KPwuoANwgydrO9ACzTxxH7XCENHdtUQX2tQyWF8NG\nNm6o\r\n=hGbp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEShKdLoktN3rzKABlQHVhsumRi/QNsEj8x749xrYXhjAiEAyqO/DGNoIw0FwSotDlKt9fLc6B5SkXcuz0/EFpsJt6o="}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype_1.2.2_1549497992118_0.8462614981550658"},"_hasShrinkwrap":false},"1.2.3":{"name":"jest-tobetype","version":"1.2.3","description":"A jest matcher that allows you to test the expected type of a value","main":"index-cjs.js","module":"index.js","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"author":{"name":"Gregory Wild-Smith"},"license":"MIT","bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","devDependencies":{"jest":"^24.7.1"},"dependencies":{"jest-get-type":"^24.3.0","jest-matcher-utils":"^24.7.0"},"gitHead":"1da911493dcfb7eeb56cddc4d747c0b94fd74892","_id":"jest-tobetype@1.2.3","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9wVkY9lDW4BhcUc0Hpc0hq7n1i/erZW59RbGMl+oAi4IKPi4YtaXHdJgQg0QMDPWtK5PiM82hw6jPbVjH61Z5A==","shasum":"ae0d0e972a52039ae1317e80f5793e17d942a623","tarball":"https://registry.npmjs.org/jest-tobetype/-/jest-tobetype-1.2.3.tgz","fileCount":5,"unpackedSize":5637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyzoOCRA9TVsSAnZWagAAdUgP/3NEmXrLto7ZXtpTizBj\n8+ZCTbBgFPrqdVso2DcizFsCQUgjSx+xt2Mx6/N7INtVPAAq3tnwYFZsx8Yf\ntLnohfOBmAAt0Vjf2AfOiiYkGlWYDOqDz7o5OLY1INLRB9in/ORjfQ8SkJBG\nDl/laecGGzH2gHEVGdTEFiO0CMfeW4r9K2g6A13b8Z9ONgzHeTd+AOW9rJG8\nyZxORLx2kEFxxaCtpPPLe1vYJIwdeOzaDNhaqs+kzuLI6LuvNpybYL764Nuc\nU7Ev7CXN3gHYjnuj/xyUoULMr5kjQ1SCSMzykUsvK7JWkJ25Z24cx9i6jbVD\nc5t3nFifYdeee6NT/eXDwKJVbUkrbBWrNgZNbdHb4i81CcN+AHzWwGsYzF57\nenl3OTZ95LLUyEQ406sGYYepq3mlY/QcgPw0/G26SWPclq8zK7SwQ6KFs7ks\nXY6O0utYHgEQ55aaIBo1MWg7drb/GfiBp9LnwYNaUI/UGpb5096BXuypsQwy\nNU9C/89X+hR7kZBP93XXra2DsFGHbYrg/udYhwOBnSiV2MGrepSxHAl2TP0F\ns9MFK4XhNESJEu9EQhqqxp2sqKzuj083065fXVIF/7lnA+rx/khQ4+HmkUab\nfjbFV3d0V40M0DZLbaGy8T8nXBWrKffTabzpVps+l5ezqASUvY402fq2aOty\n6Rn8\r\n=KWE+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5GVkvRcpgsL06XMsZgDkjLWhzMyNHnezZlgly7g3UeQIhAMJr3b/adqSIuv5lnye5vVz37nPAoxJNhHZFFfMX0RhA"}]},"maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"_npmUser":{"name":"abritinthebay","email":"darkcryst@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-tobetype_1.2.3_1556822541624_0.348339361785283"},"_hasShrinkwrap":false}},"readme":"# ToBeType\nA [Jest](https://facebook.github.io/jest/) matcher that allows you to test the expected type of a value.\n\n## Usage\nUse it like any other matcher. For example:\n\n```javascript\nexpect(\"\").toBeType(\"string\");\nexpect({}).toBeType(\"object\");\nexpect(1).toBeType(\"number\");\nexpect([]).toBeType(\"array\");\nexpect(() => {}).toBeType(\"function\");\n\n// also works with Promises\nexpect(Promise.resolve([])).resolves.toBeType(\"array\");\n```\nIt's that easy, enjoy!\n\n## Why?\n\nHave you ever been frustrated doing this for every test when you just want to check the type of a value?\n\n```javascript\n\texpect(typeof foo).toBe(\"string\");\n```\n\nOr, worse, if you're testing the result of a Promise?\n\n```javascript\n\texpect(fooPromise\n\t\t.then(data => typeof data))\n\t\t.resolves.toBe(\"object\");\n```\n\nIt's not *hard* to write this boilerplate but it *is* annoying. Strangely Jest specifically doesn't include any easy shorthand for this.\n\nWell it does now.\n\n## Installation\n\nSimple install to your project like so:\n\n```shell\nnpm i jest-tobetype --save-dev\n```\n\nThen include in your tests either in the test file you want *or* in the setup files for Jest.\n\nThe simplest way is:\n\n```javascript\nimport toBeType from \"jest-tobetype\";\nexpect.extend(toBeType);\n```\n\nThis is *probably* all you'll need to do if you're not doing anything special but if you want more options - read one.\n\nIf you have multiple extensions you are doing you may want to just import the function directly, eg:\n\n```javascript\nimport {toBeType} from \"jest-tobetype\";\nexpect.extend({\n\ttoBeType,\n\tsomeOtherThing,\n\t// and so on\n});\n```\n\nand if you have a need for it you can also do this:\n\n```javascript\nimport {extend} from \"jest-tobetype\";\nextend(expect);\n```\n\nThough that's there mostly just because I like functional programming.\n\n(Note: if you use the setup files make sure to extend in `setupTestFrameworkScriptFile` as `extend` is not available in `setupFiles`).\n","maintainers":[{"name":"abritinthebay","email":"darkcryst@gmail.com"}],"time":{"modified":"2022-05-06T12:48:24.436Z","created":"2017-10-06T21:56:43.162Z","1.0.0":"2017-10-06T21:56:43.162Z","1.1.0":"2017-10-10T18:43:16.781Z","1.2.0":"2018-09-20T19:44:51.746Z","1.2.1":"2019-02-06T23:59:31.244Z","1.2.2":"2019-02-07T00:06:32.266Z","1.2.3":"2019-05-02T18:42:21.729Z"},"homepage":"https://github.com/abritinthebay/jest-tobetype#readme","keywords":["jest","typeof","type","matcher","expects","tdd","testing","test","bdd"],"repository":{"type":"git","url":"git+ssh://git@github.com/abritinthebay/jest-tobetype.git"},"author":{"name":"Gregory Wild-Smith"},"bugs":{"url":"https://github.com/abritinthebay/jest-tobetype/issues"},"license":"MIT","readmeFilename":"README.md","users":{"fmakareev":true,"tdmalone":true}}