diff --git a/types/test/v3/reactivity-test.ts b/types/test/v3/reactivity-test.ts index c357bf8d5c7..624994c68db 100644 --- a/types/test/v3/reactivity-test.ts +++ b/types/test/v3/reactivity-test.ts @@ -13,9 +13,10 @@ import { markRaw, shallowReadonly, set, - del + del, + ShallowRef } from '../../index' -import { IsUnion, describe, expectType } from '../utils' +import { IsUnion, describe, expectType, expectError } from '../utils' function plainType(arg: number | Ref) { // ref coercing @@ -163,6 +164,13 @@ if (shallowStatus.value === 'initial') { shallowStatus.value = 'invalidating' } +expectType>(shallowRef(1)) +expectType>>( + shallowRef({} as { name: string } | Ref<{ name: string }>) +) +expectType>(shallowRef(ref('foo'))) +expectType>(shallowRef(shallowRef('foo'))) + const refStatus = ref('initial') if (refStatus.value === 'initial') { expectType>(shallowStatus) @@ -386,7 +394,6 @@ describe('set/del', () => { del([], 'fse', 123) }) - { //#12978 type Steps = { step: '1' } | { step: '2' } @@ -395,4 +402,4 @@ describe('set/del', () => { expectType>(false) expectType>(false) -} \ No newline at end of file +}