Skip to content

Commit 7508276

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

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/type/tests/integration4.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
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';
15+
import { expectType } from './utils';
1516

1617
test('group from enum', () => {
1718
enum Groups {
@@ -143,3 +144,13 @@ test('union loosely', () => {
143144
expect(cast<a>({ id: 2 })).toEqual({ id: 2 });
144145
expect(cast<a>({ id: '3' })).toEqual({ id: 3 });
145146
});
147+
148+
test('extract type annotation options', () => {
149+
type Skip = TypeAnnotation<'skip', { if: boolean }>;
150+
151+
type SkipOptions = ExtractTypeAnnotationOptions<Skip>;
152+
153+
const options: SkipOptions = {
154+
if: true,
155+
};
156+
});

0 commit comments

Comments
 (0)