chore(deps): update dependency expect-type to ^0.20.0#1132
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency expect-type to ^0.20.0#1132renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
8 times, most recently
from
January 10, 2026 13:50
ddf872b to
c469b4b
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
3 times, most recently
from
January 18, 2026 07:34
42fb351 to
502bf76
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
2 times, most recently
from
January 18, 2026 07:41
0ceef10 to
64871c4
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
from
January 27, 2026 21:46
64871c4 to
1e72d09
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
2 times, most recently
from
February 6, 2026 20:33
da8538b to
69ecc9c
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
5 times, most recently
from
February 19, 2026 21:00
b9b9dad to
0edf8a9
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
5 times, most recently
from
March 4, 2026 10:38
090c9c3 to
644d387
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
from
March 6, 2026 21:17
644d387 to
c719591
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
2 times, most recently
from
April 16, 2026 10:38
a4db542 to
8ba06fb
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
3 times, most recently
from
April 23, 2026 10:06
7bb27c5 to
f580887
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
17 times, most recently
from
May 8, 2026 10:34
e47282c to
92036d6
Compare
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
7 times, most recently
from
May 8, 2026 12:10
259d1a3 to
cf97b5a
Compare
renovate
Bot
force-pushed
the
renovate/expect-type-0.x
branch
from
May 13, 2026 04:31
cf97b5a to
9b3c58a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.15.0→^0.20.0Release Notes
mmkal/expect-type (expect-type)
v0.20.0Compare Source
Breaking changes
This change updates how overloaded functions are treated. Now,
.parametersgives you a union of the parameter-tuples that a function can take. For example, given the following type:Behvaiour before:
Behaviour now:
There were similar changes for
.returns,.parameter(...), and.toBeCallableWith. Also, overloaded functions are now differentiated properly when using.branded.toEqualTypeOf(this was a bug that it seems nobody found).See #83 for more details or look at the updated docs (including a new section called "Overloaded functions", which has more info on how this behaviour differs for TypeScript versions before 5.3).
What's Changed
1e37116@internalJSDoc tag (#104)4c40b07overloads.tsfile (#107)5ee01810bbeffaFull Changelog: mmkal/expect-type@v0.19.0...v0.20.0
v0.19.0Compare Source
What's Changed
.omit()to work similarly toOmitby @aryaemami59 in #54testimport inREADME.mdby @aryaemami59 in #65Full Changelog: mmkal/expect-type@0.18.0...0.19.0
v0.18.0Compare Source
What's Changed
.pickand.omitby @aryaemami59 in #51New Contributors
Full Changelog: mmkal/expect-type@v0.17.3...0.18.0
v0.17.3Compare Source
907b8aav0.17.2Compare Source
4b38117Diff(truncated - scroll right!):
test('toEqualTypeOf with tuples', () => { const assertion = `expectTypeOf<[[number], [1], []]>().toEqualTypeOf<[[number], [2], []]>()` expect(tsErrors(assertion)).toMatchInlineSnapshot(` - "test/test.ts:999:999 - error TS2344: Type '[[number], [2], []]' does not satisfy the constraint '{ [x: number]: { [x: number]: number; [iterator]: (() => IterableIterator<1>) | (() => IterableIterator<number>) | (() => IterableIterator<never>); [unscopables]: (() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }) | (() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }) | (() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }); length: 0 | 1; toString: ... truncated!!!!'. - Types of property 'sort' are incompatible. - Type '(compareFn?: ((a: [] | [number] | [2], b: [] | [number] | [2]) => number) | undefined) => [[number], [2], []]' is not assignable to type '\\"Expected: function, Actual: function\\"'. + "test/test.ts:999:999 - error TS2344: Type '[[number], [2], []]' does not satisfy the constraint '{ 0: { 0: number; }; 1: { 0: \\"Expected: literal number: 2, Actual: literal number: 1\\"; }; 2: {}; }'. + The types of '1[0]' are incompatible between these types. + Type '2' is not assignable to type '\\"Expected: literal number: 2, Actual: literal number: 1\\"'. 999 expectTypeOf<[[number], [1], []]>().toEqualTypeOf<[[number], [2], []]>() ~~~~~~~~~~~~~~~~~~~" `) })v0.17.1Compare Source
.notand.brandedtogethercf38918(this was actually documented in the v0.17.0 release but really it was only pushed here)
v0.17.0Compare Source
#16 went in to - hopefully - significantly improve the error messages produce on failing assertions. Here's an example of how vitest's failing tests were improved:
Before:
After:
Docs copied from the readme about how to interpret these error messages
Error messages
When types don't match,
.toEqualTypeOfand.toMatchTypeOfuse a special helper type to produce error messages that are as actionable as possible. But there's a bit of an nuance to understanding them. Since the assertions are written "fluently", the failure should be on the "expected" type, not the "actual" type (expect<Actual>().toEqualTypeOf<Expected>()). This means that type errors can be a little confusing - so this library produces aMismatchInfotype to try to make explicit what the expectation is. For example:Is an assertion that will fail, since
{a: 1}has type{a: number}and not{a: string}. The error message in this case will read something like this:Note that the type constraint reported is a human-readable messaging specifying both the "expected" and "actual" types. Rather than taking the sentence
Types of property 'a' are incompatible // Type 'string' is not assignable to type "Expected: string, Actual: number"literally - just look at the property name ('a') and the message:Expected: string, Actual: number. This will tell you what's wrong, in most cases. Extremely complex types will of course be more effort to debug, and may require some experimentation. Please raise an issue if the error messages are actually misleading.The
toBe...methods (liketoBeString,toBeNumber,toBeVoidetc.) fail by resolving to a non-callable type when theActualtype under test doesn't match up. For example, the failure for an assertion likeexpectTypeOf(1).toBeString()will look something like this:The
This expression is not callablepart isn't all that helpful - the meaningful error is the next line,Type 'ExpectString<number> has no call signatures. This essentially means you passed a number but asserted it should be a string.If TypeScript added support for "throw" types these error messagess could be improved. Until then they will take a certain amount of squinting.
Concrete "expected" objects vs typeargs
Error messages for an assertion like this:
Will be less helpful than for an assertion like this:
This is because the TypeScript compiler needs to infer the typearg for the
.toEqualTypeOf({a: ''})style, and this library can only mark it as a failure by comparing it against a genericMismatchtype. So, where possible, use a typearg rather than a concrete type for.toEqualTypeOfandtoMatchTypeOf. If it's much more convenient to compare two concrete types, you can usetypeof:Kinda-breaking changes: essentially none, but technically,
.brandedno longer returns a "full"ExpectTypeOfinstance at compile-time. Previously you could do this:Now that won't work (and it was always slightly nonsensical), so you'd have to use
// @​ts-expect-errorinstead ofnotif you have a negated case where you needbranded:What's Changed
New Contributors
Full Changelog: mmkal/expect-type@v0.16.0...v0.17.0
v0.16.0Compare Source
What's Changed
thisparameters by @mmkal and @papb in #15Equalto use the equality check fromReadonlyEquivalentexclusively by @trevorade in #21Note that #21 has affected behavior for intersection types, which can result in (arguably) false errors:
Full Changelog: mmkal/expect-type@v0.15.0...v16.0.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.