RTL/vitest.config.ts
continue[bot] 4d2b925c1f Add backend unit tests for CommonService utilities
- Set up Vitest testing framework for backend TypeScript tests
- Add vitest.config.ts with coverage configuration
- Add comprehensive tests for server/utils/common.ts including:
  - maskPasswords: password field masking in objects
  - convertTimeToEpoch: date to epoch conversion
  - sortAscByKey/sortDescByKey: numeric sorting utilities
  - sortAscByStrKey/sortDescByStrKey: string sorting utilities
  - newestOnTop: array reordering
  - camelCase/titleCase: string case conversion
  - isVersionCompatible: semantic version comparison
  - getMonthDays: calendar month day calculation
  - findNode: node lookup by index
  - removeAuthSecureData/removeSecureData: secure data removal
  - getRequestIP: client IP extraction
  - handleError: error response formatting for LND/CLN/ECL
  - runWithConcurrencyLimit: concurrent task execution
- Add npm scripts for backend testing: test:backend and test:backend:coverage
- 59 tests passing with coverage reporting

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
Co-authored-by: shahana-farooqui <shahana.farooqui@gmail.com>
2026-04-01 16:07:03 +00:00

15 lines
357 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['server/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['server/**/*.ts'],
exclude: ['server/**/*.test.ts', 'server/models/**']
}
}
});