We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05df696 commit 848ccf5Copy full SHA for 848ccf5
packages/reactivity/__tests__/reactive.spec.ts
@@ -113,6 +113,19 @@ describe('reactivity/reactive', () => {
113
expect('foo' in original).toBe(false)
114
})
115
116
+ test('original value change should reflect in observed value (Object)', () => {
117
+ const original: any = { foo: 1 }
118
+ const observed = reactive(original)
119
+ // set
120
+ original.bar = 1
121
+ expect(original.bar).toBe(1)
122
+ expect(observed.bar).toBe(1)
123
+ // delete
124
+ delete original.foo
125
+ expect('foo' in original).toBe(false)
126
+ expect('foo' in observed).toBe(false)
127
+ })
128
+
129
test('setting a property with an unobserved value should wrap with reactive', () => {
130
const observed = reactive<{ foo?: object }>({})
131
const raw = {}
0 commit comments