hareku
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
0 deletions
-
packages/reactivity/__tests__/ref.spec.ts
|
|
@ -33,6 +33,17 @@ describe('reactivity/ref', () => { |
|
|
|
expect(dummy).toBe(2) |
|
|
|
}) |
|
|
|
|
|
|
|
it('should work without initial value', () => { |
|
|
|
const a = ref() |
|
|
|
let dummy |
|
|
|
effect(() => { |
|
|
|
dummy = a.value |
|
|
|
}) |
|
|
|
expect(dummy).toBe(undefined) |
|
|
|
a.value = 2 |
|
|
|
expect(dummy).toBe(2) |
|
|
|
}) |
|
|
|
|
|
|
|
it('should work like a normal property when nested in a reactive object', () => { |
|
|
|
const a = ref(1) |
|
|
|
const obj = reactive({ |
|
|
|