import {expectType} from 'tsd'; import {expectTypeOf} from 'expect-type'; import type {OverrideProperties} from '../source/override-properties.d.ts'; type Foo = { a: number; b: string; }; const fixture: OverrideProperties = {a: 1, b: 2}; expectType<{a: number; b: number}>(fixture); // @ts-expect-error type Bar1 = OverrideProperties; // @ts-expect-error type Bar2 = OverrideProperties; // Test for https://github.com/sindresorhus/type-fest/issues/858 { // eslint-disable-line no-lone-blocks type Original = { foo: string; bar: string; }; type Modified = { foo: string | undefined; bar: string; }; type Final = OverrideProperties; expectTypeOf().toMatchTypeOf<{foo: string | undefined; bar: string}>(); }