Skip to content

Commit

Permalink
test(type): extract type annotation options
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Feb 9, 2024
1 parent 19e973f commit fa64d90
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/type/tests/integration4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import { expect, test } from '@jest/globals';
import { assertType, AutoIncrement, Group, groupAnnotation, PrimaryKey, ReflectionKind } from '../src/reflection/type.js';
import { assertType, AutoIncrement, ExtractTypeAnnotationOptions, Group, groupAnnotation, PrimaryKey, ReflectionKind, TypeAnnotation } from '../src/reflection/type.js';
import { typeOf } from '../src/reflection/reflection.js';
import { cast } from '../src/serializer-facade.js';

Expand Down Expand Up @@ -143,3 +143,13 @@ test('union loosely', () => {
expect(cast<a>({ id: 2 })).toEqual({ id: 2 });
expect(cast<a>({ id: '3' })).toEqual({ id: 3 });
});

test('extract type annotation options', () => {
type Skip = TypeAnnotation<'skip', { if: boolean }>;

type SkipOptions = ExtractTypeAnnotationOptions<Skip>;

const options: SkipOptions = {
if: true,
};
});

0 comments on commit fa64d90

Please sign in to comment.