|
|
@@ -23,6 +23,7 @@ import {
|
|
|
ref,
|
|
|
shallowRef,
|
|
|
toRaw,
|
|
|
+ triggerRef,
|
|
|
} from '../src'
|
|
|
import { EffectFlags, pauseTracking, resetTracking } from '../src/effect'
|
|
|
import type { ComputedRef, ComputedRefImpl } from '../src/computed'
|
|
|
@@ -1004,4 +1005,10 @@ describe('reactivity/computed', () => {
|
|
|
await nextTick()
|
|
|
expect(serializeInner(root)).toBe(`<button>Step</button><p>Step 2</p>`)
|
|
|
})
|
|
|
+
|
|
|
+ it('manual trigger computed', () => {
|
|
|
+ const cValue = computed(() => 1)
|
|
|
+ triggerRef(cValue)
|
|
|
+ expect(cValue.value).toBe(1)
|
|
|
+ })
|
|
|
})
|