Skip to content

Commit 3cb45eb

Browse files
author
FatRadish
committed
test: add test case for #12807
1 parent 2d4ad8a commit 3cb45eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/reactivity/__tests__/reactive.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ describe('reactivity/reactive', () => {
301301
expect(() => markRaw(obj)).not.toThrowError()
302302
})
303303

304+
test('should not markRaw object as reactive', () => {
305+
const a = reactive({ a: 1 })
306+
const b = reactive({ b: 2 }) as any
307+
b.a = markRaw(toRaw(a))
308+
expect(b.a === a).toBe(false)
309+
})
310+
304311
test('should not observe non-extensible objects', () => {
305312
const obj = reactive({
306313
foo: Object.preventExtensions({ a: 1 }),

0 commit comments

Comments
 (0)