I am trying to write a test, using vitest, to assert a computed property in a vue3 component that is defined with script setup.
Consider a simple component:
// simple.vue
<script lang="ts" setup>
import { computed } from 'vue';
const hello = computed((): string => {
return 'Hello';
});
</script>
<template>
{{ hello }}
</template>
My test is like this:
describe('Hello', () => {
it('should compute hello', () => {
const wrapper = mount(Hello);
expect(wrapper.vm.hello).toBe('Hello');
});
});
This test actually works as expected when run using vitest, so functionally things seem to be working well.
However, VSCode cannot see the computed properties on the vm object:
It is able to see normal properties (e.g., those defined with the defineProps macro). Is this just a problem with VSCode-specific tooling, or is there another way I should be going about testing computed properties in vue3 components?
If this is the preferred method, is there a way to pull in the types of the computed properties (similar to how the types of the defined props seem to be pulled in)?
I have tried the technique described in this Vue Testing Handbook, but this doesn't work at all and I assume it must be specific to vue2.

