diff --git a/tests/components/ScriptSetup_Expose.vue b/tests/components/ScriptSetup_Expose.vue index d2dc97d4b..bbe741de9 100644 --- a/tests/components/ScriptSetup_Expose.vue +++ b/tests/components/ScriptSetup_Expose.vue @@ -7,9 +7,13 @@ const count = ref(0) const inc = () => { count.value++ } +const resetCount = () => { + count.value = 0 +} defineExpose({ - count + count, + resetCount }) diff --git a/tests/expose.spec.ts b/tests/expose.spec.ts index 3cec8475c..e2276621e 100644 --- a/tests/expose.spec.ts +++ b/tests/expose.spec.ts @@ -40,6 +40,10 @@ describe('expose', () => { expect(wrapper.html()).toContain('1') // can access `count` as it is exposed via `defineExpose()` expect(wrapper.vm.count).toBe(1) + + wrapper.vm.resetCount() + + expect(wrapper.vm.count).toBe(0) }) it('access vm with