{"id":24687282,"url":"https://github.com/tstyche/tstyche","last_synced_at":"2026-04-02T22:56:44.266Z","repository":{"id":206413794,"uuid":"716586726","full_name":"tstyche/tstyche","owner":"tstyche","description":"The Essential Type Testing Tool.","archived":false,"fork":false,"pushed_at":"2024-10-29T20:36:00.000Z","size":5600,"stargazers_count":65,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T22:49:49.882Z","etag":null,"topics":["developer-tools","expect","test","test-runner","testing-tools","types","typescript"],"latest_commit_sha":null,"homepage":"https://tstyche.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tstyche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["mrazauskas"]}},"created_at":"2023-11-09T12:57:33.000Z","updated_at":"2024-10-29T20:35:42.000Z","dependencies_parsed_at":"2024-03-23T16:24:55.901Z","dependency_job_id":"0a09499a-bb15-495b-b539-cf3d32ebe725","html_url":"https://github.com/tstyche/tstyche","commit_stats":null,"previous_names":["tstyche/tstyche"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tstyche%2Ftstyche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tstyche%2Ftstyche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tstyche%2Ftstyche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tstyche%2Ftstyche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tstyche","download_url":"https://codeload.github.com/tstyche/tstyche/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085604,"owners_count":20721210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","expect","test","test-runner","testing-tools","types","typescript"],"created_at":"2025-01-26T16:18:21.101Z","updated_at":"2026-04-02T22:56:44.259Z","avatar_url":"https://github.com/tstyche.png","language":"JavaScript","readme":"# TSTyche\n\n[![version][version-badge]][version-url]\n[![license][license-badge]][license-url]\n[![install-size][install-size-badge]][install-size-url]\n[![coverage][coverage-badge]][coverage-url]\n\nEverything You Need for Type Testing.\n\n---\n\nTSTyche is a type testing tool for TypeScript. It ships with `describe()` and `test()` helpers, `expect` style assertions and a mighty test runner.\n\n## Helpers\n\nIf you are used to testing, a type test should look familiar:\n\n```ts\nimport { expect, test } from \"tstyche\";\n\nfunction isSameLength\u003cT extends { length: number }\u003e(a: T, b: T) {\n  return a.length === b.length;\n}\n\ntest(\"isSameLength\", () =\u003e {\n  expect(isSameLength([1, 2], [1, 2, 3])).type.toBe\u003cboolean\u003e();\n  expect(isSameLength(\"one\", \"two\")).type.toBe\u003cboolean\u003e();\n\n  expect(isSameLength).type.not.toBeCallableWith(1, 2);\n});\n```\n\nTo group and organize tests, TSTyche has:\n\n- `test()`, `it()` and `describe()` helpers,\n- with `.only`, `.skip` and `.todo` run mode flags.\n\n## Assertions\n\nThe `expect` style assertions can check either the inferred type of an expression (as in the example above) or a type directly:\n\n```ts\nimport { type _, expect } from \"tstyche\";\n\ntype AsyncProps\u003cT\u003e = {\n  [K in keyof T]+?: T[K] | Promise\u003cT[K]\u003e;\n};\n\ntype WithLoading\u003cT extends object\u003e = T \u0026 { loading: boolean };\n\nexpect\u003cWithLoading\u003cAsyncProps\u003c{ query: string }\u003e\u003e\u003e().type.toBe\u003c{\n  query?: string | Promise\u003cstring\u003e;\n  loading: boolean;\n}\u003e();\n\nexpect\u003cWithLoading\u003c_\u003e\u003e().type.not.toBeInstantiableWith\u003c[string]\u003e();\n```\n\nRelation matchers:\n\n- `.toBe()` checks if a type is the same as the given type,\n- `.toBeAssignableFrom()` checks if a type is assignable from the given type,\n- `.toBeAssignableTo()` checks if a type is assignable to the given type.\n\nAbility matchers:\n\n- `.toAcceptProps()` checks if a JSX component accepts the given props,\n- `.toBeApplicable` checks if a decorator is applicable to the given class or class member,\n- `.toBeCallableWith()` checks if a function is callable with the given arguments,\n- `.toBeConstructableWith()` checks if a class is constructable with the given arguments,\n- `.toBeInstantiableWith()` checks if a generic is instantiable with the given type arguments,\n- `.toHaveProperty()` checks if a type has the given property.\n\n## Runner\n\nThe `tstyche` command is the heart of TSTyche. It allows you to select test files by path, filter tests by name and run them against specific versions of TypeScript:\n\n```shell\ntstyche query-params --only multiple --target '\u003e=5.6'\n```\n\nIt is that simple! Actually, TSTyche does even more:\n\n- checks messages of errors suppressed by `@ts-expect-error` directives,\n- generates type tests from a data table,\n- runs tests in watch mode.\n\n## Try It Out\n\nTry TSTyche online on StackBlitz:\n\n[![Open in StackBlitz][starter-badge]][starter-url]\n\n## Documentation\n\nVisit [tstyche.org](https://tstyche.org) to view the full documentation.\n\n## License\n\n[MIT][license-url] © TSTyche\n\n[version-badge]: https://badgen.net/npm/v/tstyche\n[version-url]: https://npmjs.com/package/tstyche\n[license-badge]: https://badgen.net/github/license/tstyche/tstyche\n[license-url]: https://github.com/tstyche/tstyche/blob/main/LICENSE.md\n[install-size-badge]: https://badgen.net/packagephobia/install/tstyche\n[install-size-url]: https://packagephobia.com/result?p=tstyche\n[coverage-badge]: https://badgen.net/codecov/github/tstyche/tstyche\n[coverage-url]: https://app.codecov.io/gh/tstyche/tstyche\n[starter-badge]: https://developer.stackblitz.com/img/open_in_stackblitz.svg\n[starter-url]: https://tstyche.org/new\n","funding_links":["https://github.com/sponsors/mrazauskas"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftstyche%2Ftstyche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftstyche%2Ftstyche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftstyche%2Ftstyche/lists"}