From e6d4fadbaa7bcb2f9d35f5e2f604a07e4a336def Mon Sep 17 00:00:00 2001 From: linzhe Date: Mon, 3 Feb 2025 22:33:33 +0800 Subject: [PATCH] test: update test unit --- packages/reactivity/__tests__/reactive.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/reactivity/__tests__/reactive.spec.ts b/packages/reactivity/__tests__/reactive.spec.ts index aabd954568a..b5dcd401a97 100644 --- a/packages/reactivity/__tests__/reactive.spec.ts +++ b/packages/reactivity/__tests__/reactive.spec.ts @@ -301,6 +301,13 @@ describe('reactivity/reactive', () => { expect(() => markRaw(obj)).not.toThrowError() }) + test('should not mark raw object as reactive', () => { + const a = reactive({ a: 1 }) + const b = reactive({ b: 2 }) as any + b.a = markRaw(toRaw(a)) + expect(b.a === a).toBe(false) + }) + test('should not observe non-extensible objects', () => { const obj = reactive({ foo: Object.preventExtensions({ a: 1 }),