feat(typescript-types): Add test for any and never in OptionalKeysOf

This commit is contained in:
T. R. Bernstein
2025-07-14 13:48:59 +02:00
parent 610e7a0518
commit a7bc60fa69
2 changed files with 8 additions and 3 deletions

View File

@@ -31,6 +31,9 @@ expect<OptionalKeysOf<Example1 | Example2>>().type.toBe<
'optionalKey' | 'anotherOptional' | 'optionalKey2' | 'anotherOptional2'
>()
expect<OptionalKeysOf<any>>().type.toBe<string | number>()
expect<OptionalKeysOf<never>>().type.toBeAssignableWith<never>()
expect<Pick<Example1, OptionalKeysOf<Example1>>>().type.toBe<
ExpectKeyOf<Example1, OptionalKeysOf<Example1>>
>()