Skip to content

Commit

Permalink
chore: Extend expose tests with not used function (#1735)
Browse files Browse the repository at this point in the history
chore: Extend expose tests with not used function
  • Loading branch information
freakzlike committed Aug 25, 2022
1 parent 7ecfa4a commit 60ff6bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/components/ScriptSetup_Expose.vue
Expand Up @@ -7,9 +7,13 @@ const count = ref(0)
const inc = () => {
count.value++
}
const resetCount = () => {
count.value = 0
}
defineExpose({
count
count,
resetCount
})
</script>

Expand Down
4 changes: 4 additions & 0 deletions tests/expose.spec.ts
Expand Up @@ -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 <script setup> even without defineExpose()', async () => {
Expand Down

0 comments on commit 60ff6bd

Please sign in to comment.