mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
Adiciona 81 testes unitários cobrindo backend e frontend: Backend (50 testes): - utils/version: isNewerVersion, parseMajorVersion (14 testes) - utils/misc: formatSpeed, toTitleCase, parseBoolean (17 testes) - utils/fs: determineFileType, matchesDevice, sanitizeFilename (14 testes) - validators/common: assertNotPrivateUrl - proteção SSRF (9 testes) Frontend (27 testes): - lib/classNames: concatenação condicional de classes (5 testes) - lib/util: capitalizeFirstLetter, formatBytes, extractFileName (12 testes) - hooks/useDiskDisplayData: getAllDiskDisplayItems, getPrimaryDiskInfo (6 testes) Infraestrutura: - Instala vitest, @testing-library/react, jsdom - Configura vitest.config.ts com aliases para ~ e #app - Script npm test:unit para rodar todos os testes Closes #491
21 lines
445 B
TypeScript
21 lines
445 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import { resolve } from 'path'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: 'jsdom',
|
|
include: [
|
|
'inertia/__tests__/**/*.test.ts',
|
|
'tests/unit/**/*.test.ts',
|
|
],
|
|
globals: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'~': resolve(__dirname, 'inertia'),
|
|
'#app': resolve(__dirname, 'app'),
|
|
'#validators': resolve(__dirname, 'app/validators'),
|
|
},
|
|
},
|
|
})
|