withastro / language-tools

Language tools for Astro
MIT License
272 stars 54 forks source link

🐛 BUG: @astrojs/language-server v2.7.6 not honouring Vue `defineExpose` in test files #817

Open spacedawwwg opened 8 months ago

spacedawwwg commented 8 months ago

Describe the Bug

After upgrading to @astrojs/language-server v2.7.6, astro check fails in my test files (e.g. Mycomponent.spec.ts) when using @vue/test-utils and defineExpose

Steps to Reproduce

  1. npm init astro using template
  2. set up using Vue integration
  3. add a defineExpose to a vue file
  4. try to use said expose (e.g. wrapper.vm.myExposedThing)
  5. IDE typescript picks up the expose
  6. run astro check
  7. type check errors
@namespace/package-name:typecheck: > astro check --tsconfig tsconfig.check.json
@namespace/package-name:typecheck: 15:02:41 [check] Getting diagnostics for Astro files in
@namespace/package-name:typecheck:
@namespace/package-name:typecheck: src/components/ComponentName/__tests__/ComponentName.unit.test.ts:58:23 - error ts(2339): Property 'active' does not exist on type 'ComponentPublicInstance<ComponentNameProps, Omit<{ items: string[]; }, keyof ComponentNameProps>>'.
@namespace/package-name:typecheck: 
@namespace/package-name:typecheck: 58     expect(wrapper.vm.active.title).toBe('test');
spacedawwwg commented 8 months ago

Locked in at v2.7.5 for now as this is working

spacedawwwg commented 7 months ago

Just following up – Is it likely this will be triaged at any time soon?