Back to Explore

mmkal/expect-type

GitHub
1 updates · last 90 days1 watchersOpen source

Last release:

expect-type provides `expectTypeOf` compile-time tests for TypeScript types. It lets you assert the shape and constraints of values and generic type parameters (for example, equality, subtype/extends relationships, and checks for any or unknown) so type definitions don’t become overly permissive over time.

Project status

  • Actively maintained, with the most recent upstream push on 2026-07-01 and a new tagged update v1.4.0 on 2026-06-25, indicating ongoing work.
  • Apparent update cadence is moderate rather than continuous, roughly several months between notable tagged updates in recent history (for example, v1.3.0 on 2025-12-08 to v1.4.0 on 2026-06-25).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.4.0

    v1.4.0 adds `.branded.inspect` for detecting deeply nested `any`/`never`/`unknown` paths, and improves `thisParameter` handling, including overload support and a fallback for non-callable cases. The code changes also include a broader refactor of branding/equality internals to introduce configurable “deep brand” options that propagate through mismatch/error typing.

    Features
  • v1.3.0

    v1.3.0 bumps the library and CI typechecking to TypeScript 5.9 and adjusts the type-level error reporting logic. The main user-visible change is improved compile-time error output when expected or actual types involve optional properties.

  • v1.2.2

    v1.2.2 primarily updates the project’s TypeScript toolchain and CI. It includes a fix related to tsgo (with CI coverage), bumps TypeScript to 5.8.x, and adds a SECURITY.md policy document.

    Security
  • v1.2.1

    Release v1.2.1 only updates documentation in the README. The examples were adjusted to avoid deprecated `.toMatchTypeOf` usage and to reference the preferred alternatives.

  • v1.2.0

    v1.2.0 adds new type assertion helpers, `.toMatchObjectType` and `.toExtend`, intended as replacements for the deprecated `.toMatchTypeOf`. It also introduces a `.map` utility for transforming types at compile time. The release notes focus on the deprecation and usage differences, but the code contains additional behavioral constraints for `.toMatchObjectType` not fully spelled out.

    Features
  • v1.1.0

    This release adds support for asserting bigint types via a new expecter method, `toBeBigInt()`. It also extends type-printing logic so bigint and bigint literals display correctly in error messages. In addition to library changes, the repo updates CI test reporting and bumps dev dependencies related to Vitest.

    Features
  • v1.0.0

    v1.0.0 is positioned as a non-functional “make it official” release based on prior v0.x and v1.0.0-rc.0 work, with usage documentation included for new users. The provided release notes do not describe any new user-facing features or behavioral changes for this final v1.0.0 tag.

  • v1.0.0-rc.0

    The v1.0.0-rc.0 release notes state the release candidate is being published as-is, with no changes besides dev dependency updates since v0.20.0. However, the actual diff shows not only dependency bumps, but also a substantial change to the repository dependency sync GitHub Actions workflow and updated dev toolchain requirements.

  • v0.20.0

    v0.20.0 focuses on improved TypeScript overload support, changing how expect-type derives parameter and return types from overloaded function types. It also re-exports the overload-related helpers from the package root and adds multiple documentation and JSDoc cleanups. CI and dev tooling were updated to include a new type-checking job (arethetypeswrong) and newer dev dependencies.

    BreakingFeatures
  • v0.20.0-0

    v0.20.0-0 is primarily a type-level overhaul focused on better handling of overloaded functions, updating how overload parameter and return types are surfaced through matchers like `.parameters`, `.returns`, `.parameter(...)`, and `.toBeCallableWith`. The codebase also underwent a significant internal refactor, moving major type helper logic out of `src/index.ts` into new modules such as `src/utils.ts`, `src/branding.ts`, `src/messages.ts`, and `src/overloads.ts`.

    BreakingFeatures
  • 0.19.0

    Release 0.19.0 documents a fix to make `.omit()` behave more like TypeScript's `Omit`, plus adds JSDoc across the codebase and tweaks the README. However, the actual diff shows a broader toolchain and CI overhaul (Jest to Vitest, ESLint config migration, CI coverage changes, and tsconfig target changes) that is not mentioned in the release notes.