Skip to content

Commit d1764a1

Browse files
committed
test: simplify computed last sub test case
1 parent 6fcb801 commit d1764a1

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/reactivity/__tests__/computed.spec.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -1013,16 +1013,9 @@ describe('reactivity/computed', () => {
10131013
})
10141014

10151015
test('computed should remain live after losing all subscribers', () => {
1016-
const toggle = ref(true)
1017-
const state = reactive({
1018-
a: 1,
1019-
})
1016+
const state = reactive({ a: 1 })
10201017
const p = computed(() => state.a + 1)
1021-
const pp = computed(() => {
1022-
return toggle.value ? p.value : 111
1023-
})
1024-
1025-
const { effect: e } = effect(() => pp.value)
1018+
const { effect: e } = effect(() => p.value)
10261019
e.stop()
10271020

10281021
expect(p.value).toBe(2)

0 commit comments

Comments
 (0)