test: configure Vitest and add 54 unit tests (F6.1, F6.2)

Set up Vitest with happy-dom, mock Nuxt auto-imports via #imports alias.
Add tests for: inventory-types validators (9), apiHelpers (10),
modelUtils (18), useConfirm (8), useToast (9). All 54 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-02-09 11:20:28 +01:00
parent 6152848957
commit 634184c2be
9 changed files with 1099 additions and 11 deletions

View File

@@ -10,7 +10,9 @@
"postinstall": "nuxt prepare",
"start": "nuxt start",
"lint": "eslint . --ext .js,.ts,.vue",
"lint:fix": "npm run lint -- --fix"
"lint:fix": "npm run lint -- --fix",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@nuxtjs/tailwindcss": "^6.14.0",
@@ -28,10 +30,13 @@
"@types/node": "^25.2.1",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"@vue/test-utils": "^2.4.6",
"eslint": "^9.36.0",
"eslint-plugin-vue": "^10.5.0",
"happy-dom": "^20.5.3",
"typescript": "^5.7.3",
"unplugin-icons": "^0.19.3",
"vitest": "^4.0.18",
"vue-eslint-parser": "^10.2.0"
}
}