{"id":26670772,"url":"https://github.com/crbroughton/ts-test-utils","last_synced_at":"2026-02-24T01:33:10.318Z","repository":{"id":233773354,"uuid":"787587407","full_name":"CRBroughton/ts-test-utils","owner":"CRBroughton","description":"A collection of testing helper types","archived":false,"fork":false,"pushed_at":"2024-10-23T20:21:28.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T00:57:28.869Z","etag":null,"topics":["bun","testing","type-testing","types","typescript","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@crbroughton/ts-test-utils","language":"TypeScript","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/CRBroughton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2024-04-16T20:04:42.000Z","updated_at":"2024-10-23T20:21:32.000Z","dependencies_parsed_at":"2024-06-04T20:22:29.577Z","dependency_job_id":"0266b140-3aed-4df0-9178-875740e5ab10","html_url":"https://github.com/CRBroughton/ts-test-utils","commit_stats":null,"previous_names":["crbroughton/ts-test-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CRBroughton/ts-test-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRBroughton%2Fts-test-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRBroughton%2Fts-test-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRBroughton%2Fts-test-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRBroughton%2Fts-test-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CRBroughton","download_url":"https://codeload.github.com/CRBroughton/ts-test-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRBroughton%2Fts-test-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29766493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:28:30.166Z","status":"ssl_error","status_checked_at":"2026-02-24T01:28:27.518Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bun","testing","type-testing","types","typescript","utility"],"created_at":"2025-03-25T22:46:21.348Z","updated_at":"2026-02-24T01:33:10.298Z","avatar_url":"https://github.com/CRBroughton.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-test-utils\n\nA collection of helper TypeScript types to test other TypeScript types. This collection so far includes:\n\n- Expect - The main helper; Use this with the below types\n- Equals - Check for equality between two types\n- Assignable - Check if one type is assignable to another type\n- Excludes - Check if a type doesn't contain another type\n- Includes - Check if a type includes another type\n- Extends - Check if one type is extending another type\n- IsArray - Checks if a type is an array\n- IsNotArray - Checks if a type is not an array\n- Length - Check a given types length; Combine this with the 'Equals' type checker\n- Position - Returns a type in the given position of an array; Combine this with the 'Equals' type checker\n- IsNullable - Check if a type is nullable\n- IsNonNullable - Check if a type is not nullable\n- IsUndefined - Check if a type is undefined\n- IsNonUndefined - Check if a type is not undefined\n- IsNullish - Check if a type is either undefined or null\n- IsNonNullish - Check if a type is neither undefined or null\n- IsVoid - Check if a type is void\n- IsNonVoid - Check if a type is not void\n- NonVoid - Remove void from a union that contains void\n- isUnionEqual - Check for equality between two unions\n\n## Installation\n\nTo install `ts-test-utils` with Bun, run the following command:\n\n```bash\nbun i -D @crbroughton/ts-test-utils\n```\n\n## Getting Started\n\nYou can use these types to test other types:\n\n```typescript\n// This should return true\ntype Result = Expect\u003cEquals\u003c{ id: number }, { id: number }\u003e\u003e\n```\n\nFor testing types that are expected to not equal each-other, you can\nadd the `//@ts-expect-error` comment to tell the TypeScript compiler\nthat a `false` return is expected, and that a match is not expected:\n\n```typescript\n// @ts-expect-error - Object / Record failing the equality checker\ntype ResultRecord = Expect\u003cEquals\u003c{ id: number }, { id: string }\u003e\u003e\n```\n\nYou can combine these types with existing types. As an example,\nhere is the 'Equals' type being used to check a functions return type:\n\n```typescript\nfunction myFunction() {\n    return {\n        id: 1,\n        name: 'Craig',\n    }\n}\ntype Result = Expect\u003cEquals\u003cReturnType\u003ctypeof myFunction\u003e, { id: number, name: string }\u003e\u003e\n```\n\n## Development Installation\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\nTo run:\n\n```bash\nbun run index.ts\n```\n\nThis project was created using `bun init` in bun v1.1.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrbroughton%2Fts-test-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrbroughton%2Fts-test-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrbroughton%2Fts-test-utils/lists"}