{"id":15379910,"url":"https://github.com/iansan5653/assertion-types","last_synced_at":"2025-07-21T11:31:51.554Z","repository":{"id":42815534,"uuid":"268608224","full_name":"iansan5653/assertion-types","owner":"iansan5653","description":"Test your types using just the TypeScript compiler and no external tools.","archived":false,"fork":false,"pushed_at":"2023-07-18T22:22:20.000Z","size":149,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T08:03:35.964Z","etag":null,"topics":["linting","testing","types","typescript","utility-types"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/assertion-types","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/iansan5653.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-01T19:03:53.000Z","updated_at":"2022-10-18T14:03:22.000Z","dependencies_parsed_at":"2024-10-24T05:19:42.455Z","dependency_job_id":"8e6f84cf-2934-4505-8fc7-3310b31e5c4c","html_url":"https://github.com/iansan5653/assertion-types","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.10526315789473684","last_synced_commit":"835e80128610d0d2b749ddb4a5223d504f0d4588"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":"iansan5653/ts-boilerplate","purl":"pkg:github/iansan5653/assertion-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansan5653%2Fassertion-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansan5653%2Fassertion-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansan5653%2Fassertion-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansan5653%2Fassertion-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iansan5653","download_url":"https://codeload.github.com/iansan5653/assertion-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansan5653%2Fassertion-types/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266291564,"owners_count":23906293,"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":["linting","testing","types","typescript","utility-types"],"created_at":"2024-10-01T14:20:19.989Z","updated_at":"2025-07-21T11:31:51.529Z","avatar_url":"https://github.com/iansan5653.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### assertion-types\n\n`assertion-types` is a tiny, fast, and, easy-to-learn type-testing library that\nrequires no extra build/test setup.\n\n## Introduction\n\nThe `assertion-types` library provides four simple tests for inspecting types:\n`Equals`, `Extends`, `NotEquals`, and `NotExtends`. Along with the included\n`Assert` type, these utilities allow you to test that the results of your types\nare what you expect them to be. Because this method requires no other tools\nbesides the TypeScript compiler, errors will show up right in your editor and\nyou won't be able to build your project if your tests fail.\n\nUsage is simple:\n\n```ts\nimport {Assert, Equals, Extends, NotEquals, NotExtends} from \"assertion-types\";\n\n// Equals:\ntype EqualsExample = Assert\u003cEquals\u003c123, 123\u003e\u003e;\n\n// NotEquals:\ntype NotEqualsExample = Assert\u003cNotEquals\u003c123, 456\u003e\u003e;\n\n// Extends:\ntype ExtendsExample = Assert\u003cExtends\u003c123, number\u003e\u003e;\n\n// NotExtends:\ntype NotExtendsExample = Assert\u003cNotExtends\u003cnumber, 123\u003e\u003e;\n```\n\n## Getting Started\n\nInstall via NPM:\n\n```sh\nnpm install --save-dev assertion-types\n```\n\nAfter that, just import into your test files:\n\n```ts\nimport * as assertionTypes from \"assertion-types\";\n// OR\nimport {Assert, Equals, Extends, NotEquals, NotExtends} from \"assertion-types\";\n```\n\nNo need to run any commands to run the tests - if they error, they will error\nwhen the TypeScript compiler runs.\n\n## Purpose\n\nAny sufficiently complex TypeScript project will eventually require the\ndevelopment of utility types, which are often left untested because unit tests\ncannot be written for types. However, testing these types ensures that your type\nsystem is sound and therefore you can rely on type errors to prevent the cases\nthat you assume cannot happen based on your understanding of your types.\n\n## Comparison With Alternatives\n\nThe standard alternative for this is `dtslint`, which uses `$ExpectType`\ncomments to test types with an external tool. However, this requires an\nadditional testing step rather than just taking advantage of the compiler's\nabilities. A failed `$ExpectType` will only error when someone runs the\n`dtslint` command, while an error with these utilities will never make it past\n`tsc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiansan5653%2Fassertion-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiansan5653%2Fassertion-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiansan5653%2Fassertion-types/lists"}