test(reactivity): 100% reactivity coverage (#1299)

This commit is contained in:
蜗牛老湿
2020-06-12 04:55:56 +08:00
committed by GitHub
parent 3fafc3b3ac
commit 426803046f
3 changed files with 17 additions and 0 deletions

View File

@@ -214,6 +214,7 @@ describe('reactivity/readonly', () => {
const key2 = {}
const original = new Collection([[key1, {}], [key2, {}]])
const wrapped: any = readonly(original)
expect(wrapped.size).toBe(2)
for (const [key, value] of wrapped) {
expect(isReadonly(key)).toBe(true)
expect(isReadonly(value)).toBe(true)
@@ -267,6 +268,7 @@ describe('reactivity/readonly', () => {
test('should retrieve readonly values on iteration', () => {
const original = new Collection([{}, {}])
const wrapped: any = readonly(original)
expect(wrapped.size).toBe(2)
for (const value of wrapped) {
expect(isReadonly(value)).toBe(true)
}