Skip to content

Commit fa64d90

Browse files
committed
test(type): extract type annotation options
1 parent 19e973f commit fa64d90

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: packages/type/tests/integration4.spec.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

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

@@ -143,3 +143,13 @@ test('union loosely', () => {
143143
expect(cast<a>({ id: 2 })).toEqual({ id: 2 });
144144
expect(cast<a>({ id: '3' })).toEqual({ id: 3 });
145145
});
146+
147+
test('extract type annotation options', () => {
148+
type Skip = TypeAnnotation<'skip', { if: boolean }>;
149+
150+
type SkipOptions = ExtractTypeAnnotationOptions<Skip>;
151+
152+
const options: SkipOptions = {
153+
if: true,
154+
};
155+
});

0 commit comments

Comments
 (0)