feat(reactivity): add isShallow api
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
} from '../src/index'
|
||||
import { computed } from '@vue/runtime-dom'
|
||||
import { shallowRef, unref, customRef, triggerRef } from '../src/ref'
|
||||
import { isShallow } from '../src/reactive'
|
||||
|
||||
describe('reactivity/ref', () => {
|
||||
it('should hold a value', () => {
|
||||
@@ -227,6 +228,10 @@ describe('reactivity/ref', () => {
|
||||
expect(dummy).toBe(2)
|
||||
})
|
||||
|
||||
test('shallowRef isShallow', () => {
|
||||
expect(isShallow(shallowRef({ a: 1 }))).toBe(true)
|
||||
})
|
||||
|
||||
test('isRef', () => {
|
||||
expect(isRef(ref(1))).toBe(true)
|
||||
expect(isRef(computed(() => 1))).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user