diff --git a/packages/reactivity/__tests__/computed.spec.ts b/packages/reactivity/__tests__/computed.spec.ts index c044b5feb35..5c0252c68a3 100644 --- a/packages/reactivity/__tests__/computed.spec.ts +++ b/packages/reactivity/__tests__/computed.spec.ts @@ -151,6 +151,14 @@ describe('reactivity/computed', () => { expect(n.value).toBe(-1) }) + it('should support passing object with only one get property', () => { + const a = computed(() => 1) + // @ts-expect-error + const b = computed({ get: () => 1 }) + expect(isReadonly(a)).toBe(true) + expect(isReadonly(b)).toBe(true) + }) + it('should trigger effect w/ setter', () => { const n = ref(1) const plusOne = computed({