test: change vitest config (#7)

Bootstrap mínimo do harness Vitest para o p2pix-front-end. Adiciona configuração, polyfills de DOM, e cobertura inicial de utils + 1 componente simples — apenas o que roda contra `develop` sem dependências
  externas.

Co-authored-by: Arthur Abeilice <afa7789@gmail.com>
Reviewed-on: https://git.p2pix.co/doiim/p2pix-front-end/pulls/7
This commit is contained in:
arthur
2026-05-30 17:40:47 +00:00
committed by hueso
parent 7887f50b1a
commit c47968333f
3 changed files with 45 additions and 2 deletions

View File

@@ -12,7 +12,10 @@
"lint:fix": "eslint --fix",
"format": "prettier --write \"src/**/*.{ts,vue,json}\"",
"format:check": "prettier --check \"src/**/*.{ts,vue,json}\"",
"wagmi:gen": "wagmi generate"
"wagmi:gen": "wagmi generate",
"test": "vitest run --passWithNoTests",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@floating-ui/vue": "^1.1.11",

40
vitest.config.ts Normal file
View File

@@ -0,0 +1,40 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig, mergeConfig } from 'vitest/config';
import viteConfig from './vite.config';
export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: 'happy-dom',
globals: true,
include: ['tests/**/*.{test,spec}.ts'],
exclude: [
'p2pix-smart-contracts/**',
'vendor/**',
'**/node_modules/**',
],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
include: ['src/**/*.{ts,vue}'],
exclude: [
'src/main.ts',
'src/router/**',
'src/assets/**',
'src/generated.ts',
'src/subgraph/generated.ts',
'**/*.d.ts',
'**/__mocks__/**',
'p2pix-smart-contracts/**',
'vendor/**',
],
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
}),
);