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

2
.gitignore vendored
View File

@@ -13,4 +13,4 @@ bun.lock
AGENTS.md
AI_GUIDE.md
CLAUDE.md
.coverage/
coverage/

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 })

View File

@@ -3,9 +3,10 @@ import { resolve } from 'node:path';
import { defineConfig } from 'vitest/config';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
export default defineConfig({
plugins: [vue()],
plugins: [vue(),vueJsx()],
define: {
NIGHTLY: JSON.stringify(false),
WINDOWS: JSON.stringify(true),