From 5cab3eb32e7a9ba1c87220cbd3207823d6998bfd Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 8 Aug 2024 16:08:40 +0200 Subject: [PATCH] chore: prepare CI --- package.json | 6 ++++-- vitest.config.ci.ts | 14 ++++++++++++++ vitest.config.local.ts | 14 ++++++++++++++ vitest.config.ts | 14 -------------- 4 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 vitest.config.ci.ts create mode 100644 vitest.config.local.ts delete mode 100644 vitest.config.ts 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)) - } - }) -)