[Vuejs]-I want to use jest to write vue-next ,but I meet some matters

0👍

In contrast to React refs that have current property, Vue composition API refs have value property.

It should be:

const refLatest = ref(num)
refLatest.value = num.value

and

expect(isRef(current1)).toBe(true)
expect(current1.value).toBe(0)

And the mistake could be detected at compilation time by using the correct type:

const useLatest = <T>(num: T): Ref<T> => {

Leave a comment