Files
hnh-map/frontend-nuxt/vitest.setup.ts
Nikolay Tatarinov 337386caa8 Enhance Vitest configuration and improve Vue integration
- Added Vue plugin to vitest.config.ts for better component testing.
- Introduced vitest.setup.ts to expose Vue reactivity and lifecycle methods globally, ensuring compatibility with .vue components.
- Updated mock implementations in nuxt-imports.ts to include readonly for improved reactivity handling.
- Refactored useMapBookmarks and useToast composables to utilize readonly from Vue for better state management.
2026-03-04 14:12:48 +03:00

28 lines
452 B
TypeScript

/**
* Expose Vue reactivity and lifecycle on globalThis so that .vue components
* that rely on Nuxt auto-imports (ref, computed, etc.) work in Vitest.
*/
import {
ref,
computed,
reactive,
watch,
watchEffect,
onMounted,
onUnmounted,
nextTick,
readonly,
} from 'vue'
Object.assign(globalThis, {
ref,
computed,
reactive,
watch,
watchEffect,
onMounted,
onUnmounted,
nextTick,
readonly,
})