test(web): add Vitest setup and unit tests for validations and utils

- Add vitest config and test script to web app
- Auth validation tests: phone format, password rules, registration flow
- Listing validation tests: all schema steps, constants, merged schema
- Utils tests: cn() class merging with Tailwind conflict resolution
- 36 tests across 3 test files

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 14:59:00 +07:00
parent 6baa4707de
commit cd2abdba7b
6 changed files with 349 additions and 2 deletions

13
apps/web/vitest.config.ts Normal file
View File

@@ -0,0 +1,13 @@
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
include: ['**/__tests__/**/*.spec.ts', '**/__tests__/**/*.test.ts'],
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
});