diff --git a/package.json b/package.json index 8c2f781..302f4ab 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,13 @@ "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", - "test:unit": "vitest", + "test:unit": "vitest -c vitest.config.ci.ts", + "test:unit:local": "vitest -c vitest.config.local.ts --ui", "build-only": "vite build", "type-check": "vue-tsc --build --force", - "format": "prettier --write src/" "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "format": "prettier --write src/", + "format-check": "prettier --check src/" }, "dependencies": { "@fontsource/poppins": "^5.0.8", diff --git a/vitest.config.ci.ts b/vitest.config.ci.ts new file mode 100644 index 0000000..b9ff02f --- /dev/null +++ b/vitest.config.ci.ts @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url'; +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'; +import viteConfig from './vite.config'; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)), + }, + }) +); diff --git a/vitest.config.local.ts b/vitest.config.local.ts new file mode 100644 index 0000000..b9ff02f --- /dev/null +++ b/vitest.config.local.ts @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url'; +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'; +import viteConfig from './vite.config'; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)), + }, + }) +); diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index 10067d5..0000000 --- a/vitest.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { fileURLToPath } from 'node:url' -import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' -import viteConfig from './vite.config' - -export default mergeConfig( - viteConfig, - defineConfig({ - test: { - environment: 'jsdom', - exclude: [...configDefaults.exclude, 'e2e/*'], - root: fileURLToPath(new URL('./', import.meta.url)) - } - }) -)