reactive.spec.ts (vue-2.7.13) | : | reactive.spec.ts (vue-2.7.14) | ||
---|---|---|---|---|
skipping to change at line 262 | skipping to change at line 262 | |||
test('markRaw', () => { | test('markRaw', () => { | |||
const obj = reactive({ | const obj = reactive({ | |||
foo: { a: 1 }, | foo: { a: 1 }, | |||
bar: markRaw({ b: 2 }) | bar: markRaw({ b: 2 }) | |||
}) | }) | |||
expect(isReactive(obj.foo)).toBe(true) | expect(isReactive(obj.foo)).toBe(true) | |||
expect(isReactive(obj.bar)).toBe(false) | expect(isReactive(obj.bar)).toBe(false) | |||
}) | }) | |||
test('markRaw on non-extensible objects', () => { | test('markRaw on non-extensible objects', () => { | |||
const foo = Object.freeze({}) | const foo = Object.seal({}) | |||
markRaw(foo) | markRaw(foo) | |||
expect(isReactive(reactive(foo))).toBe(false) | expect(isReactive(reactive(foo))).toBe(false) | |||
}) | }) | |||
test('should not observe non-extensible objects', () => { | test('should not observe non-extensible objects', () => { | |||
const obj = reactive({ | const obj = reactive({ | |||
foo: Object.preventExtensions({ a: 1 }), | foo: Object.preventExtensions({ a: 1 }), | |||
// sealed or frozen objects are considered non-extensible as well | // sealed or frozen objects are considered non-extensible as well | |||
bar: Object.freeze({ a: 1 }), | bar: Object.freeze({ a: 1 }), | |||
baz: Object.seal({ a: 1 }) | baz: Object.seal({ a: 1 }) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |