From: Evan You Date: Sun, 22 Sep 2024 03:24:10 +0000 (+0800) Subject: test: simplify computed last sub test case X-Git-Tag: v3.5.8~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1764a142abada80283ec1134bad193c5622557a;p=thirdparty%2Fvuejs%2Fcore.git test: simplify computed last sub test case --- diff --git a/packages/reactivity/__tests__/computed.spec.ts b/packages/reactivity/__tests__/computed.spec.ts index 90987e8672..873fd11619 100644 --- a/packages/reactivity/__tests__/computed.spec.ts +++ b/packages/reactivity/__tests__/computed.spec.ts @@ -1013,16 +1013,9 @@ describe('reactivity/computed', () => { }) test('computed should remain live after losing all subscribers', () => { - const toggle = ref(true) - const state = reactive({ - a: 1, - }) + const state = reactive({ a: 1 }) const p = computed(() => state.a + 1) - const pp = computed(() => { - return toggle.value ? p.value : 111 - }) - - const { effect: e } = effect(() => pp.value) + const { effect: e } = effect(() => p.value) e.stop() expect(p.value).toBe(2)