From 7508276c5e375c355261eeb081f09ee182f9c2c9 Mon Sep 17 00:00:00 2001 From: marcus-sa Date: Fri, 9 Feb 2024 13:29:38 +0100 Subject: [PATCH] test(type): extract type annotation options --- packages/type/tests/integration4.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/type/tests/integration4.spec.ts b/packages/type/tests/integration4.spec.ts index f8eb70413..c03015641 100644 --- a/packages/type/tests/integration4.spec.ts +++ b/packages/type/tests/integration4.spec.ts @@ -9,9 +9,10 @@ */ 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'; +import { expectType } from './utils'; test('group from enum', () => { enum Groups { @@ -143,3 +144,13 @@ test('union loosely', () => { expect(cast({ id: 2 })).toEqual({ id: 2 }); expect(cast({ id: '3' })).toEqual({ id: 3 }); }); + +test('extract type annotation options', () => { + type Skip = TypeAnnotation<'skip', { if: boolean }>; + + type SkipOptions = ExtractTypeAnnotationOptions; + + const options: SkipOptions = { + if: true, + }; +});