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 AGENTS.md
AI_GUIDE.md AI_GUIDE.md
CLAUDE.md CLAUDE.md
.coverage/ coverage/

View File

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

View File

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