type-enhancers
Version:
Enhanced type system
17 lines (11 loc) • 472 B
text/typescript
import { expectTypeOf } from 'vitest';
const TEST_1 = ''.trim();
expectTypeOf(TEST_1).toEqualTypeOf<''>();
const TEST_2 = 'some text'.trim();
expectTypeOf(TEST_2).toEqualTypeOf<'some text'>();
const TEST_3 = ' some text'.trim();
expectTypeOf(TEST_3).toEqualTypeOf<'some text'>();
const TEST_4 = 'some text '.trim();
expectTypeOf(TEST_4).toEqualTypeOf<'some text'>();
const TEST_5 = ' some text '.trim();
expectTypeOf(TEST_5).toEqualTypeOf<'some text'>();