Add comprehensive test suite for chat app

- Add userRepository.test.js: User CRUD, authentication, OAuth providers, 2FA, affiliate tracking
- Add sessionRepository.test.js: Sessions, refresh tokens, token blacklist, device fingerprinting
- Add auditRepository.test.js: Audit logging, event types, time-based queries, success/failure tracking
- Add connection.test.js: Database initialization, transactions, foreign keys, backup operations
- Add model-routing.test.js: Provider fallback, plan validation, token rates, rate limiting
- Add payments.test.js: Subscription pricing, top-ups, PAYG, discounts, webhook handling
- Add api-endpoints.test.js: Auth endpoints, user management, admin endpoints, middleware
- Update package.json with test scripts (bun test)

Tests cover: accounts, authentication, model routing, payments, subscriptions, admin panel, API endpoints
This commit is contained in:
southseact-3d
2026-02-18 18:30:41 +00:00
parent 1b3b2cdf2a
commit 8e35b2af95
8 changed files with 3823 additions and 1 deletions

View File

@@ -4,7 +4,9 @@
"description": "",
"main": "agents.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "bun test",
"test:watch": "bun test --watch",
"test:coverage": "bun test --coverage",
"start": "node server.js"
},
"keywords": [],