{"_id":"types-testing","_rev":"3-2177ba1ae13893556ebbb47dc3daccb8","name":"types-testing","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"types-testing","version":"1.0.0","keywords":["typescript","type-definitions","types","test","unit-test","types-testing","type-testing","bun","jest","ts-jest","vitest","tsd","expectType","toBe","toBeAny","toBeNever","toBeUnknown","toExtends","toAssignable"],"author":{"name":"codeismyid"},"license":"MIT","_id":"types-testing@1.0.0","maintainers":[{"name":"codeismyid","email":"codeismyid@gmail.com"}],"homepage":"https://github.com/codeismyid/types-testing#readme","bugs":{"url":"https://github.com/codeismyid/types-testing/issues"},"dist":{"shasum":"9a4b350531f9af88a989695d775d5011098de86a","tarball":"https://registry.npmjs.org/types-testing/-/types-testing-1.0.0.tgz","fileCount":55,"integrity":"sha512-1NPuVcS0cI7xCHZ77wtA5dxEW1grNznIje8uvq55dso2+BR/PpaQPEKlCaFDYL9MGEFpJ2OPHoZycj6zqLsc7A==","signatures":[{"sig":"MEYCIQDprqszOprgQeBSHu1U3SrD/c7vc1LK7UIG+NJNbYFjIQIhAPh02dYMGU5NAqsXGB2d42G0MfX/5zY+s8qsvCxR09bT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/types-testing@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70737},"type":"module","types":"./dist/src/index.d.ts","module":"./dist/src/index.js","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./package.json":"./package.json"},"gitHead":"0748dd5013f8530cc4bfc9b2b1cba6b30b3dd3b2","scripts":{"ci":"bun install --frozen-lockfile","fix":"bun fix:format && bun fix:lint","dist":"bun clean:dist && bun ./scripts/dist.ts && bunx publint","check":"bun check:type && bun check:spec && bun check:format && bun check:lint","clean":"bun clean:deps && bun clean:docs && bun clean:dist && bun clean:codecov","prepare":"bunx husky || true","release":"bun ./scripts/release.ts","fix:lint":"bunx biome lint --fix","reinstall":"bun clean:deps && bun install","check:lint":"bunx biome lint","check:spec":"bun test --coverage","check:type":"bunx tsc && bunx type-coverage","clean:deps":"rm -rf node_modules && rm -f bun.lockb && rm -f bun.lock","clean:dist":"rm -rf dist","fix:format":"bunx biome check --linter-enabled=false --fix","check:format":"bunx biome check --linter-enabled=false","jest:run-example":"cross-env FAIL_EXAMPLE_TEST=true node --experimental-vm-modules node_modules/jest/bin/jest.js example.test.ts -c=__tests__/__example/jest.config.ts","test:example:bun":"cross-env FAIL_EXAMPLE_TEST=true bun test example.test.ts","test:example:jest":"cross-env FAIL_EXAMPLE_TEST=true node --experimental-vm-modules node_modules/jest/bin/jest.js example.test.ts -c=__tests__/__example/jest.config.ts","test:example:vitest":"cross-env FAIL_EXAMPLE_TEST=true bunx vitest run example.test.ts","jest:run-integrations":"node --experimental-vm-modules node_modules/jest/bin/jest.js jest.test.ts -c=__tests__/__integrations/jest.config.ts","test:integrations:bun":"bun test bun.test.ts","test:integrations:jest":"node --experimental-vm-modules node_modules/jest/bin/jest.js jest.test.ts -c=__tests__/__integrations/jest.config.ts","test:integrations:vitest":"bunx vitest run vitest.test.ts"},"_npmUser":{"name":"codeismyid","email":"codeismyid@gmail.com"},"devEngines":{"runtime":{"name":"bun","onFail":"warn"},"packageManager":{"name":"bun","onFail":"warn"}},"repository":{"url":"git+https://github.com/codeismyid/types-testing.git","type":"git"},"_npmVersion":"10.9.2","description":"Test TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.","directories":{},"_nodeVersion":"20.19.1","dependencies":{"ansis":"3.17.0"},"typeCoverage":{"strict":true,"atLeast":100,"ignoreEmptyType":true,"showRelativePath":true,"ignoreAsAssertion":true},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","husky":"9.1.7","vitest":"3.1.2","esbuild":"0.25.4","publint":"0.3.12","ts-jest":"29.3.2","ts-node":"10.9.2","cross-env":"7.0.3","tsc-alias":"1.8.15","@types/bun":"1.2.10","typescript":"5.8.3","@types/jest":"29.5.14","@jest/globals":"29.7.0","type-coverage":"2.29.7","@biomejs/biome":"1.9.4","@commitlint/cli":"19.8.0","semantic-release":"24.2.3","@commitlint/types":"19.8.0","commitlint-format":"1.0.2","tsc-output-format":"1.1.1","conventional-changelog-conventionalcommits":"8.0.0"},"peerDependencies":{"typescript":"5.x"},"trustedDependencies":["@biomejs/biome","esbuild"],"_npmOperationalInternal":{"tmp":"tmp/types-testing_1.0.0_1746826186128_0.4458017775130261","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"types-testing","version":"1.0.1","keywords":["typescript","type-definitions","types","test","unit-test","types-testing","type-testing","bun","jest","ts-jest","vitest","tsd","expectType","toBe","toBeAny","toBeNever","toBeUnknown","toExtends","toAssignable","toEqual"],"author":{"name":"codeismyid"},"license":"MIT","_id":"types-testing@1.0.1","maintainers":[{"name":"codeismyid","email":"codeismyid@gmail.com"}],"homepage":"https://github.com/codeismyid/types-testing#readme","bugs":{"url":"https://github.com/codeismyid/types-testing/issues"},"dist":{"shasum":"7c3edd892b380df313653160d8643276fcbf98eb","tarball":"https://registry.npmjs.org/types-testing/-/types-testing-1.0.1.tgz","fileCount":55,"integrity":"sha512-T3KqhpV1O2HkfPK9A4LHDSbQHdewjaxUlm1GhCpVkMU9fENh1WMq0+2sCMqr6WEBvpHlyZj1Qy8f3EnngGAxhg==","signatures":[{"sig":"MEYCIQD1GPglkjToP4r3CxNzHaOk5U+jzcByGIRSDeVpN3pY3gIhAJlS4tHUOkkBo9/xfrxeuV/8sL9x9c0WMFPL3irS/bpv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/types-testing@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70599},"type":"module","types":"./dist/src/index.d.ts","module":"./dist/src/index.js","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./package.json":"./package.json"},"gitHead":"1cacdaa750f1753c2bb2e104c9b28e7292c74617","scripts":{"ci":"bun install --frozen-lockfile","fix":"bun fix:format && bun fix:lint","dist":"bun clean:dist && bun ./scripts/dist.ts && bunx publint","check":"bun check:type && bun check:spec && bun check:format && bun check:lint","clean":"bun clean:deps && bun clean:docs && bun clean:dist && bun clean:codecov","prepare":"bunx husky || true","release":"bun ./scripts/release.ts","fix:lint":"bunx biome lint --fix","reinstall":"bun clean:deps && bun install","check:lint":"bunx biome lint","check:spec":"bun test --coverage","check:type":"bunx tsc && bunx type-coverage","clean:deps":"rm -rf node_modules && rm -f bun.lockb && rm -f bun.lock","clean:dist":"rm -rf dist","fix:format":"bunx biome check --linter-enabled=false --fix","check:format":"bunx biome check --linter-enabled=false","test:example:bun":"cross-env FAIL_EXAMPLE_TEST=true bun test example.test.ts","test:example:jest":"cross-env FAIL_EXAMPLE_TEST=true node --experimental-vm-modules node_modules/jest/bin/jest.js example.test.ts -c=__tests__/__example/jest.config.ts","test:example:vitest":"cross-env FAIL_EXAMPLE_TEST=true bunx vitest run example.test.ts --config __tests__/__example/vitest.config.ts","test:integrations:bun":"bun test bun.test.ts","test:integrations:jest":"node --experimental-vm-modules node_modules/jest/bin/jest.js jest.test.ts -c=__tests__/__integrations/jest.config.ts","test:integrations:vitest":"bunx vitest run vitest.test.ts --config __tests__/__integrations/vitest.config.ts"},"_npmUser":{"name":"codeismyid","email":"codeismyid@gmail.com"},"devEngines":{"runtime":{"name":"bun","onFail":"warn"},"packageManager":{"name":"bun","onFail":"warn"}},"repository":{"url":"git+https://github.com/codeismyid/types-testing.git","type":"git"},"_npmVersion":"11.13.0","description":"Test TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ansis":"4.2.0"},"typeCoverage":{"strict":true,"atLeast":100,"ignoreEmptyType":true,"showRelativePath":true,"ignoreAsAssertion":true},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.3.0","husky":"9.1.7","vitest":"4.1.5","esbuild":"0.28.0","publint":"0.3.18","ts-jest":"29.4.9","ts-node":"10.9.2","cross-env":"10.1.0","tsc-alias":"1.8.16","@types/bun":"1.3.13","typescript":"6.0.3","@types/jest":"30.0.0","@jest/globals":"30.3.0","type-coverage":"2.29.7","@biomejs/biome":"2.4.13","@commitlint/cli":"20.5.2","semantic-release":"25.0.3","@commitlint/types":"20.5.0","commitlint-format":"1.1.0","tsc-output-format":"1.1.1","conventional-changelog-conventionalcommits":"9.3.1"},"peerDependencies":{"typescript":"^5 || ^6"},"trustedDependencies":["@biomejs/biome","esbuild"],"_npmOperationalInternal":{"tmp":"tmp/types-testing_1.0.1_1777573102085_0.5354066299298335","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"types-testing","version":"1.0.2","description":"Test TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.","author":{"name":"codeismyid"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/codeismyid/types-testing.git"},"homepage":"https://github.com/codeismyid/types-testing#readme","bugs":{"url":"https://github.com/codeismyid/types-testing/issues"},"publishConfig":{"access":"public","provenance":true},"keywords":["typescript","type-definitions","types","test","unit-test","types-testing","type-testing","bun","jest","ts-jest","vitest","tsd","expectType","toBe","toBeAny","toBeNever","toBeUnknown","toExtends","toAssignable","toEqual"],"scripts":{"prepare":"bunx husky || true","ci":"bun install --frozen-lockfile","clean":"bun clean:deps && bun clean:docs && bun clean:dist && bun clean:codecov","clean:deps":"rm -rf node_modules && rm -f bun.lockb && rm -f bun.lock","clean:dist":"rm -rf dist","check":"bun check:type && bun check:spec && bun check:format && bun check:lint","check:format":"bunx biome check --linter-enabled=false","check:lint":"bunx biome lint","check:spec":"bun test --coverage","check:type":"bunx tsc && bunx type-coverage","dist":"bun clean:dist && bun ./scripts/dist.ts && bunx publint","fix":"bun fix:format && bun fix:lint","fix:format":"bunx biome check --linter-enabled=false --fix","fix:lint":"bunx biome lint --fix","reinstall":"bun clean:deps && bun install","release":"bun ./scripts/release.ts","test:example:bun":"cross-env FAIL_EXAMPLE_TEST=true bun test example.test.ts","test:example:jest":"cross-env FAIL_EXAMPLE_TEST=true node --experimental-vm-modules node_modules/jest/bin/jest.js example.test.ts -c=__tests__/__example/jest.config.ts","test:example:vitest":"cross-env FAIL_EXAMPLE_TEST=true bunx vitest run example.test.ts --config __tests__/__example/vitest.config.ts","test:integrations:bun":"bun test bun.test.ts","test:integrations:jest":"node --experimental-vm-modules node_modules/jest/bin/jest.js jest.test.ts -c=__tests__/__integrations/jest.config.ts","test:integrations:vitest":"bunx vitest run vitest.test.ts --config __tests__/__integrations/vitest.config.ts"},"dependencies":{"ansis":"4.2.0"},"devDependencies":{"@biomejs/biome":"2.4.13","@commitlint/cli":"20.5.2","@commitlint/types":"20.5.0","@jest/globals":"30.3.0","@types/bun":"1.3.13","@types/jest":"30.0.0","commitlint-format":"1.1.0","conventional-changelog-conventionalcommits":"9.3.1","cross-env":"10.1.0","esbuild":"0.28.0","husky":"9.1.7","jest":"30.3.0","publint":"0.3.18","semantic-release":"25.0.3","ts-jest":"29.4.9","ts-node":"10.9.2","tsc-alias":"1.8.16","tsc-output-format":"1.1.1","type-coverage":"2.29.7","typescript":"6.0.3","vitest":"4.1.5"},"peerDependencies":{"typescript":"^5 || ^6"},"type":"module","module":"./dist/src/index.js","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./package.json":"./package.json"},"devEngines":{"runtime":{"name":"bun","onFail":"warn"},"packageManager":{"name":"bun","onFail":"warn"}},"typeCoverage":{"atLeast":100,"showRelativePath":true,"strict":true,"ignoreAsAssertion":true,"ignoreEmptyType":true},"trustedDependencies":["@biomejs/biome","esbuild"],"gitHead":"5fc619df701bb9399c23475747d2fd4903e93593","_id":"types-testing@1.0.2","_nodeVersion":"24.14.1","_npmVersion":"11.13.0","dist":{"integrity":"sha512-BL6gQK9cNj42jfvUGK2EX3llZXBY0g/BLnMsKmJjLIN6cCXyRUmkI8mk3udyuqAXQULKQsvN7ONAa3tU6I2FzA==","shasum":"8dd2bb3bf30d3d453b81f1d266fea89dd96bf8b2","tarball":"https://registry.npmjs.org/types-testing/-/types-testing-1.0.2.tgz","fileCount":55,"unpackedSize":70599,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/types-testing@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICJODT6wrHrH2rxUFTlsJGUWPJ3qgYqBY2FhtlVkRc/6AiA7mu0pW4+JaA0M/aE0CaQmltTUBmlwAa8P3O1xPiK7qg=="}]},"_npmUser":{"name":"codeismyid","email":"codeismyid@gmail.com"},"directories":{},"maintainers":[{"name":"codeismyid","email":"codeismyid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/types-testing_1.0.2_1777573473979_0.04242291539046472"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-09T21:29:46.050Z","modified":"2026-04-30T18:24:34.417Z","1.0.0":"2025-05-09T21:29:46.333Z","1.0.1":"2026-04-30T18:18:22.266Z","1.0.2":"2026-04-30T18:24:34.122Z"},"bugs":{"url":"https://github.com/codeismyid/types-testing/issues"},"author":{"name":"codeismyid"},"license":"MIT","homepage":"https://github.com/codeismyid/types-testing#readme","keywords":["typescript","type-definitions","types","test","unit-test","types-testing","type-testing","bun","jest","ts-jest","vitest","tsd","expectType","toBe","toBeAny","toBeNever","toBeUnknown","toExtends","toAssignable","toEqual"],"repository":{"type":"git","url":"git+https://github.com/codeismyid/types-testing.git"},"description":"Test TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.","maintainers":[{"name":"codeismyid","email":"codeismyid@gmail.com"}],"readme":"<div align=\"center\">\n  \n# types-testing\n\nTest TypeScript types at test runner runtime - Works seamlessly with Jest, Vitest, and Bun.\n\n[![License](https://img.shields.io/github/license/codeismyid/types-testing?style=flat-square&color=blue)](/LICENSE)\n[![NPM Latest](https://img.shields.io/npm/v/types-testing.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/types-testing)\n[![NPM Downloads](https://img.shields.io/npm/dt/types-testing.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/types-testing)\n[![NPM Min Size](https://img.shields.io/bundlejs/size/types-testing?style=flat-square&color=blue)](https://www.npmjs.com/package/types-testing)\n\n[![CI](https://img.shields.io/github/actions/workflow/status/codeismyid/types-testing/ci.yaml?style=flat-square&logo=github&label=CI&labelColor=383f47)](https://github.com/codeismyid/types-testing/actions/workflows/ci.yaml)\n[![CodeQL](https://img.shields.io/github/actions/workflow/status/codeismyid/types-testing/codeql.yaml?style=flat-square&logo=github&label=CodeQL&labelColor=383f47)](https://github.com/codeismyid/types-testing/actions/workflows/codeql.yaml)\n[![Codecov](https://img.shields.io/codecov/c/github/codeismyid/types-testing?style=flat-square&logo=codecov&label=Coverage&labelColor=383f47)](https://app.codecov.io/github/codeismyid/types-testing)\n[![Type Coverage](https://img.shields.io/badge/dynamic/json.svg?style=flat-square&logo=typescript&label=Coverage&labelColor=383f47&color=44cc11&prefix=≥&suffix=%&query=$.typeCoverage.atLeast&uri=https://github.com/codeismyid/types-testing/raw/main/package.json)](https://github.com/codeismyid/types-testing)\n\n</div>\n\n- **Types Testing**: Ensures TypeScript types or definitions are tested.\n- **Readable Tests**: Uses the expect-assertion style for clean and easy-to-read types testing.\n- **Variative Assertions**: Provides assertions like `toBe`, `toBeNever`, `toBeUnknown`, `toBeVoid`, `toBeAny`, and more for checking.\n- **Framework Agnostic**: Seamlessly works with [Jest (TypeScript)](https://jestjs.io/docs/getting-started#using-typescript), [Vitest](https://vitest.dev/), [Bun Test](https://bun.sh/docs/cli/test), and other TypeScript testing frameworks.\n- **Easy Integration**: Integrates smoothly into TypeScript testing frameworks.\n- **No Special Comments Needed**: No need to add special comment like `@ts-expect-error`, just write clean and readable types tests code inside the existing test suite.\n- **Runtime Stack Traces**: Offers detailed stack traces for failed tests.\n\n#### Example Showcases\n\nHere is an example of how `types-testing` tests TypeScript types or definitions ([sources](https://github.com/codeismyid/types-testing/tree/main/__tests__/__example])):\n\n```ts\n// example.test.ts\nimport { join } from 'node:path';\nimport { TypesTesting } from 'src';\nimport exampleModule from './example-module';\nimport * as ExampleTypes from './example-types';\n\nif (process.versions.bun) {\n  let bunTest = (await import('bun:test')).default;\n\n  if (!bunTest) {\n    bunTest = await import('bun:test');\n  }\n\n  global.describe = bunTest.describe as unknown as typeof global.describe;\n  global.test = bunTest.test as unknown as typeof global.test;\n} else if (process.env.VITEST) {\n  const vitest = await import('vitest');\n  global.describe = vitest.describe as unknown as typeof global.describe;\n  global.test = vitest.test as unknown as typeof global.test;\n}\n\nconst basePath = join(process.cwd(), '__tests__/__example');\nconst { expectType } = new TypesTesting({\n  basePath,\n  tsConfig: 'tsconfig.json'\n}).prepare();\n\ndescribe('example-module', () => {\n  test(`exampleModule.name type is 'example-module'`, () => {\n    // using runtime argument\n    expectType(exampleModule.name).toBe<'example-module'>();\n    expectType(exampleModule.name).toBeStringLiteral();\n\n    // using type argument\n    expectType<typeof exampleModule.name>().toBe<'example-module'>();\n    expectType<typeof exampleModule.name>().toBeString();\n  });\n\n  test(`exampleModule.getName type is function without parameter and return 'example-module'`, () => {\n    // using runtime argument\n    expectType(exampleModule.getName).toBe<() => 'example-module'>();\n    expectType(exampleModule.getName).toBe<{\n      (): 'example-module';\n    }>();\n    expectType(exampleModule.getName()).toBe<'example-module'>();\n\n    // using type argument\n    expectType<typeof exampleModule.getName>().toBe<() => 'example-module'>();\n    expectType<typeof exampleModule.getName>().toBe<{\n      (): 'example-module';\n    }>();\n    expectType<\n      ReturnType<typeof exampleModule.getName>\n    >().toBe<'example-module'>();\n  });\n\n  if (process.env.FAIL_EXAMPLE_TEST) {\n    test('fail example', () => {\n      expectType(exampleModule.name).toBe<string>();\n    });\n  }\n});\n\ndescribe('example-types', () => {\n  test('KeyOf is utility types for getting keys from object type', () => {\n    expectType<ExampleTypes.KeyOf<{ a: 1; b: 2; c: 3 }>>().toBe<\n      'a' | 'b' | 'c'\n    >();\n  });\n\n  if (process.env.FAIL_EXAMPLE_TEST) {\n    test('fail example', () => {\n      expectType<ExampleTypes.KeyOf<{ a: 1; b: 2; c: 3 }>>().toBe<1 | 2 | 3>();\n    });\n  }\n});\n\n// example-module.js\nexport default {\n  name: 'example-module',\n  getName(){\n    return this.name;\n  }\n};\n\n// example-module.d.ts\ndeclare const exampleModule: {\n  name: 'example-module';\n  getName(): 'example-module';\n}\n\nexport default exampleModule;\n\n// example-types.ts\nexport type KeyOf<T> = T extends T ? keyof T : never;\n```\n\n<details open>\n<summary>Result from Jest (29.7.0)</summary>\n\n```\n FAIL  __tests__/__example/example.test.ts\n  example-module\n    √ exampleModule.name type is 'example-module' (12 ms)\n    √ exampleModule.getName type is function without parameter and return 'example-module' (5 ms)\n    × fail example (2 ms)\n  example-types\n    √ KeyOf is utility types for getting keys from object type (1 ms)\n    × fail example (1 ms)\n\n  ● example-module › fail example\n\n    TypesTestingError: expectType<received>().toBe<expected>()\n\n    Expected type: string\n    Received type: \"example-module\"\n\n\n      56 |   if (process.env.FAIL_EXAMPLE_TEST) {\n      57 |     test('fail example', () => {\n    > 58 |       expectType(exampleModule.name).toBe<string>();\n         |                                      ^\n      59 |     });\n      60 |   }\n      61 | });\n\n      at Object.<anonymous> (__tests__/__example/example.test.ts:58:38)\n\n  ● example-types › fail example\n\n    TypesTestingError: expectType<received>().toBe<expected>()\n\n    Expected type: 1 | 2 | 3\n    Received type: \"a\" | \"b\" | \"c\"\n\n\n      70 |   if (process.env.FAIL_EXAMPLE_TEST) {\n      71 |     test('fail example', () => {\n    > 72 |       expectType<ExampleTypes.KeyOf<{ a: 1; b: 2; c: 3 }>>().toBe<1 | 2 | 3>();\n         |                                                              ^\n      73 |     });\n      74 |   }\n      75 | });\n\n      at Object.<anonymous> (__tests__/__example/example.test.ts:72:62)\n\nTest Suites: 1 failed, 1 total\nTests:       2 failed, 3 passed, 5 total\nSnapshots:   0 total\nTime:        2.336 s, estimated 3 s\n```\n</details>\n\n<details>\n<summary>Result from Vitest (3.1.1)</summary>\n\n```\n RUN  v3.1.2 /@codeismyid/types-testing\n\n ❯ __tests__/__example/example.test.ts (5 tests | 2 failed) 12ms\n   ✓ example-module > exampleModule.name type is 'example-module' 6ms\n   ✓ example-module > exampleModule.getName type is function without parameter and return 'example-module' 2ms\n   × example-module > fail example 2ms\n     → expectType<received>().toBe<expected>()\n\nExpected type: string\nReceived type: \"example-module\"\n\n   ✓ example-types > KeyOf is utility types for getting keys from object type 0ms\n   × example-types > fail example 1ms\n     → expectType<received>().toBe<expected>()\n\nExpected type: 1 | 2 | 3\nReceived type: \"a\" | \"b\" | \"c\"\n\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\n\n FAIL  __tests__/__example/example.test.ts > example-module > fail example\nTypesTestingError: expectType<received>().toBe<expected>()\n\nExpected type: string\nReceived type: \"example-module\"\n\n ❯ __tests__/__example/example.test.ts:55:38\n     56|   if (process.env.FAIL_EXAMPLE_TEST) {\n     57|     test('fail example', () => {\n     58|       expectType(exampleModule.name).toBe<string>();\n       |                                      ^\n     59|     });\n     60|   }\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯\n\n FAIL  __tests__/__example/example.test.ts > example-types > fail example\nTypesTestingError: expectType<received>().toBe<expected>()\n\nExpected type: 1 | 2 | 3\nReceived type: \"a\" | \"b\" | \"c\"\n\n ❯ __tests__/__example/example.test.ts:69:62\n     70|   if (process.env.FAIL_EXAMPLE_TEST) {\n     71|     test('fail example', () => {\n     72|       expectType<ExampleTypes.KeyOf<{ a: 1; b: 2; c: 3 }>>().toBe<1 | 2 | 3>();\n       |                                                              ^\n     73|     });\n     74|   }\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯\n\n\n Test Files  1 failed (1)\n      Tests  2 failed | 3 passed (5)\n   Start at  21:39:24\n   Duration  2.78s (transform 185ms, setup 0ms, collect 2.33s, tests 12ms, environment 0ms, prepare 122ms)\n```\n</details>\n\n<details>\n<summary>Result from Bun Test (1.1.42)</summary>\n\n```\nbun test v1.1.42 (50eec002)\n\n__tests__/__example/example.test.ts:\n✓ example-module > exampleModule.name type is 'example-module' [16.00ms]\n✓ example-module > exampleModule.getName type is function without parameter and return 'example-module' [15.00ms]\n53 |     >().toBe<'example-module'>();\n54 |   });\n55 |\n56 |   if (process.env.FAIL_EXAMPLE_TEST) {\n57 |     test('fail example', () => {\n58 |       expectType(exampleModule.name).toBe<string>();\n                                          ^\nTypesTestingError: expectType<received>().toBe<expected>()\n\nExpected type: string\nReceived type: \"example-module\"\n\n      at /@codeismyid/types-testing/__tests__/__example/example.test.ts:58:38\n✗ example-module > fail example [16.00ms]\n✓ example-types > KeyOf is utility types for getting keys from object type\n67 |     >();\n68 |   });\n69 |\n70 |   if (process.env.FAIL_EXAMPLE_TEST) {\n71 |     test('fail example', () => {\n72 |       expectType<ExampleTypes.KeyOf<{ a: 1; b: 2; c: 3 }>>().toBe<1 | 2 | 3>();\n                                                                  ^\nTypesTestingError: expectType<received>().toBe<expected>()\n\nExpected type: 1 | 2 | 3\nReceived type: \"a\" | \"b\" | \"c\"\n\n      at /@codeismyid/types-testing/__tests__/__example/example.test.ts:72:62\n✗ example-types > fail example [16.00ms]\n\n 3 pass\n 2 fail\nRan 5 tests across 1 files. [2.09s]\n```\n</details>\n\n\n## Installation\n\n```bash\n# NPM\nnpm install --save-dev types-testing\n\n# BUN\nbun add -d types-testing\n```\n\n\n## Usage\n\n#### Default Options\n\n```ts\nimport { expectType } from 'types-testing';\n\ndescribe('test', () => {\n  test('test', () => {\n    expectType<string>().toBe<string>();\n  });\n});\n```\n> Note: `prepare` function get invoked when `expectType` is called at the first time with `process.cwd()` as base path and `tsconfig.json` as TypeScript configuration file.\n\n#### Custom Typescript Configuration File \n\n```ts\nimport { expectType, prepare } from 'types-testing';\n\nprepare({ basePath: 'this/is/basepath', tsConfig: 'tsconfig.test.json' });\n\ndescribe('test', () => {\n  test('test', () => {\n    expectType<string>().toBe<string>();\n  });\n});\n```\n\n#### Extending Typescript Configuration File\n\n```ts\nimport { expectType, prepare } from 'types-testing';\n\nprepare({\n  basePath: 'this/is/basepath',\n  tsConfig: 'tsconfig.test.json',\n  compilerOptions: {\n    // add ts compiler options to extends typescript compiler options from tsconfig file\n  },\n  files: [\n    // add included files to extends included files from tsconfig file\n  ],\n  projectReferences: [\n    // add project references to extends project references from tsconfig file.\n  ]\n});\n\ndescribe('test', () => {\n  test('test', () => {\n    expectType<string>().toBe<string>();\n  });\n});\n```\n\n#### Configuration Without Typescript Configuration File \n\n```ts\nimport { expectType, prepare } from 'types-testing';\n\nprepare({\n  compilerOptions: {\n    // add ts compiler options\n  },\n  files: [\n    // add included files\n  ]\n})\n\ndescribe('test', () => {\n  test('test', () => {\n    expectType<string>().toBe<string>();\n  });\n});\n```\n\n#### Custom Instance\n\n```ts\nimport { TypesTesting } from 'types-testing';\n\nconst { expectType, prepare } = new TypesTesting({ \n  autoPrepare: false,\n  basePath: process.cwd(), \n  tsConfig: 'tsconfig.test.json' \n});\n\ndescribe('test', () => {\n  beforeAll(()=>{\n    prepare();\n  });\n\n  test('test', () => {\n    expectType<string>().toBe<string>();\n  });\n});\n```\n\n\n## Developed With\n\n- [Typescript](https://www.typescriptlang.org/) - Strongly typed programming language that builds on JavaScript.\n- [Bun](https://bun.sh/) - All-in-one JavaScript runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager.\n\n\n## License\n\nThe code in this project is released under the [MIT License](LICENSE).","readmeFilename":"README.md"}