fix vitest config

This commit is contained in:
pa
2026-03-13 13:47:21 +09:00
parent 1ffb2c8b95
commit 843c53c065
3 changed files with 15 additions and 10 deletions

View File

@@ -12,14 +12,18 @@ const setString = vi.fn();
const friends = ref([]);
let routeName = 'not-tools';
vi.mock('vue-router', () => ({
useRouter: () => ({ push }),
useRoute: () => ({
get name() {
return routeName;
}
})
}));
vi.mock('vue-router', async (importOriginal) => {
const actual = await importOriginal();
return {
...actual,
useRouter: () => ({ push }),
useRoute: () => ({
get name() {
return routeName;
}
})
};
});
vi.mock('vue-i18n', () => ({
useI18n: () => ({ t: (key) => key })