{"name":"expect-type","version":"0.3.2-master-2020-03-02-22-57-03.79","repository":{"type":"git","url":"git+https://github.com/mmkal/ts.git"},"homepage":"https://github.com/mmkal/ts/tree/master/packages/expect-type#readme","license":"Apache-2.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p ."},"dependencies":{"fp-ts":"^2.1.0","io-ts":"^2.0.1"},"gitHead":"87ab11fc2d22f7b105be15a6d918c1da38920a8f","readme":"# expect-type\n\nCompile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time.\n\n## Usage\n\n```cli\nnpm install expect-type\n```\n\n<!-- codegen:start {preset: regex, source: src/__tests__/index.test.ts, between: [it(', it('], header: \"import {expectTypeOf} from 'expect-type'\"} -->\n```typescript\nimport {expectTypeOf} from 'expect-type'\n\nit('tests types', () => {\n  expectTypeOf({a: 1}).toEqualTypeOf({a: 1})\n  expectTypeOf({a: 1, b: 1}).toMatchTypeOf({a: 1})\n  expectTypeOf({a: 1}).not.toMatchTypeOf({b: 1})\n\n  expectTypeOf({a: 1}).toEqualTypeOf({a: 2})\n\n  expectTypeOf<unknown>().toBeUnknown()\n  expectTypeOf<any>().toBeAny()\n  expectTypeOf<never>().toBeNever()\n\n  expectTypeOf(() => 1).toBeFunction()\n  expectTypeOf({}).toBeObject()\n  expectTypeOf([]).toBeArray()\n  expectTypeOf('').toBeString()\n  expectTypeOf(1).toBeNumber()\n  expectTypeOf(true).toBeBoolean()\n  expectTypeOf(Promise.resolve(123)).resolves.toBeNumber()\n  expectTypeOf(Symbol(1)).toBeSymbol()\n\n  expectTypeOf(undefined).toBeUndefined()\n  expectTypeOf(undefined).toBeNullable()\n  expectTypeOf(undefined).not.toBeNull()\n\n  expectTypeOf(null).toBeNull()\n  expectTypeOf(null).toBeNullable()\n  expectTypeOf(null).not.toBeUndefined()\n\n  expectTypeOf<1 | undefined>().toBeNullable()\n  expectTypeOf<1 | null>().toBeNullable()\n  expectTypeOf<1 | undefined | null>().toBeNullable()\n\n  expectTypeOf(1).not.toBeUnknown()\n  expectTypeOf(1).not.toBeAny()\n  expectTypeOf(1).not.toBeNever()\n  expectTypeOf(1).not.toBeNull()\n  expectTypeOf(1).not.toBeUndefined()\n  expectTypeOf(1).not.toBeNullable()\n\n  const obj = {a: 1, b: ''}\n\n  expectTypeOf(obj)\n    .property('a')\n    .toEqualTypeOf(1)\n  expectTypeOf(obj)\n    .property('b')\n    .toEqualTypeOf<string>()\n\n  const f = (a: number) => [a, a]\n\n  expectTypeOf(f).toBeFunction()\n  expectTypeOf('hi').not.toBeFunction()\n\n  expectTypeOf(f).toBeCallableWith(1)\n  expectTypeOf(f).not.toBeAny()\n  expectTypeOf(f).returns.not.toBeAny()\n  expectTypeOf(f).returns.toEqualTypeOf([1, 2])\n  expectTypeOf(f).returns.toEqualTypeOf([1, 2, 3])\n  expectTypeOf(f)\n    .parameter(0)\n    .not.toEqualTypeOf('1')\n  expectTypeOf(f)\n    .parameter(0)\n    .toEqualTypeOf(1)\n  expectTypeOf(1)\n    .parameter(0)\n    .toBeNever()\n\n  const twoArgFunc = (a: number, b: string) => ({a, b})\n\n  expectTypeOf(twoArgFunc).parameters.toEqualTypeOf<[number, string]>()\n\n  const asyncFunc = async () => 123\n\n  expectTypeOf(asyncFunc).returns.resolves.toBeNumber()\n\n  const thrower = () => {\n    throw Error()\n  }\n\n  expectTypeOf(thrower).returns.toBeNever()\n\n  expectTypeOf([1, 2, 3]).items.toBeNumber()\n  expectTypeOf([1, 2, 3]).items.not.toBeString()\n\n  expectTypeOf<{a: number; b?: number}>().not.toEqualTypeOf<{a: number}>()\n  expectTypeOf<{a: number; b?: number | null}>().not.toEqualTypeOf<{a: number; b?: number}>()\n  expectTypeOf<{a: number; b?: number | null}>().toEqualTypeOf<{a: number; b?: number | null}>()\n})\n```\n<!-- codegen:end -->\n\n## Similar projects\n\nOther projects with similar goals:\n\n- [`ts-expect`](https://github.com/TypeStrong/ts-expect) exports several generic helper types to perform type assertions\n- [`dtslint`](https://github.com/Microsoft/dtslint) does type checks via comment directives and tslint\n- [`tsd-check`](https://github.com/SamVerschueren/tsd-check/issues/10) is a CLI that runs the TypeScript type checker over assertions\n- [`type-plus`](https://github.com/unional/type-plus) comes with various type and runtime TypeScript assertions\n- [`static-type-assert`](https://github.com/ksxnodemodules/static-type-assert) type assertion functions\n","readmeFilename":"readme.md","description":"Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time.","bugs":{"url":"https://github.com/mmkal/ts/issues"},"_id":"expect-type@0.3.2-master-2020-03-02-22-57-03.79","_nodeVersion":"12.16.1","_npmVersion":"lerna/3.18.1/node@v12.16.1+x64 (linux)","dist":{"integrity":"sha512-fYKkow+7/EWcSt+zNmk7OReT/W/GOMtZh9q305Ai6E8IXQj28aR2GNOKVVE2l+tU/90AD4YujaZ6t8Vy6C4mHw==","shasum":"4fcb5db6c15e3f1bc2997c9261540d99ac87c06c","tarball":"http://registry-npm.ywwl.com/expect-type/download/expect-type-0.3.2-master-2020-03-02-22-57-03.79.tgz","fileCount":16,"unpackedSize":184526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXdX5CRA9TVsSAnZWagAAQKEP/1SIaWSJqsq3Sj4IDcB9\nhG1Q+aco2U//ZyUf47y5ofWVxEdpoJuZD7BVNl8SHXKxaCOSKl8ptQDZXWvT\naTvyfbOL6lKdFqKxRoNJsS79r+MAjazxargOpL7r6GAeLOjSIZoEKEAqVZ42\no/J08hcOmHdj72FFRfX64dcg2dIJJyqkb+WBcvgLCbg9Rzg0xSXR56/QfS4+\n+WWHgf7DEItizJtKy+EzXgHnC3lYyAYdueicId3fs2xjziHwttwnPR+x91LQ\nHNv7nibUC2h1XSATAAtsEX6DAeJ4XzegnIJ9zgNEWNLdYGPQYZG1bjDTHSEL\nEgoZFWKpx2CZnrQXK+qH1ZvXEzAz2cfrtx3z7QrmLhadN9UmAL23kWP00VOA\n00OOGX/CCz4MgKOdko+B/MGdTD2jVf3qtkNqOIqWVs1hznIqqR8t/WZf3nJM\n7ijajvS7dluusThjChG/7CLos1UwhVURIgbvCMaKjT6OYCw4SuqMYgXeCsa+\n1kHaP+lDoebKoYcMbhMxJX5zaJZQp6V5CFb8TPVzGAVrm8xXgPQsArlJ97d4\nHKW84EL5O9h3f9vApIiWdAAwrbMX2xN55rrXWoDjuM58jRztyAcdT3cgMtNI\nuNoJNSk1OxWRXYWfaARf3XkvdZwbkJT8zw3lQwXrLv3SueVVxR/AYxDHG2Zc\nJSSV\r\n=v37d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqYVMDcnghDvID5HWWUpsMHGOouy5U6QrBWr7j2I51twIhAPls8lq30UAwgBhHks1d4brN/rWoVpjsN03qoATsjaWs"}],"size":21785,"noattachment":false,"key":"/expect-type/-/expect-type-0.3.2-master-2020-03-02-22-57-03.79.tgz"},"maintainers":[{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expect-type_0.3.2-master-2020-03-02-22-57-03.79_1583207928799_0.8460773212564172"},"_hasShrinkwrap":false,"publish_time":1583207928937,"_cnpm_publish_time":1583207928937,"dist-tags":{"latest":"1.4.0","master":"0.4.1-master-2020-03-06-00-05-12.11","next":"1.0.0-rc.0"}}