managarten/packages
Wuesteon c5d662bb89 test(cors): add comprehensive unit tests for shared-nestjs-cors
Add 63 unit tests with 100% code coverage for CORS configuration utilities.

**Test Coverage:**
- createCorsConfig() function (24 tests)
  - Default behavior and configuration structure
  - Environment variable parsing (comma-separated, trimming)
  - includeAllManaApps flag functionality
  - Custom development origins
  - Additional origins (mobile apps)
  - Origin deduplication across all sources
  - Combined options integration

- createCorsConfigWithCallback() function (15 tests)
  - Callback mode for mobile app support
  - No origin handling (server-to-server)
  - Valid/invalid origin validation
  - Security: protocol-sensitive matching
  - Callback return value validation

- Origin constants (24 tests)
  - MANACORE_STAGING_ORIGINS validation
  - MANACORE_PRODUCTION_ORIGINS validation
  - MANACORE_ALL_APP_ORIGINS combination
  - URL format validation
  - Duplicate detection
  - Consistency between environments

**Results:**
- 63 tests passing
- 100% code coverage (statements, branches, functions, lines)
- All edge cases covered (empty values, whitespace, duplicates)

**Setup:**
- Added Jest with ts-jest for TypeScript support
- Added test scripts: test, test:watch, test:coverage
- Created jest.config.js with coverage configuration
- Proper TypeScript types for callback functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 18:11:13 +01:00
..
better-auth-types feat(auth): add centralized @manacore/better-auth-types package 2025-12-16 02:43:55 +01:00
eslint-config feat: add multi-layered runtime config protection system 2025-12-16 00:28:57 +01:00
mana-core-nestjs-integration fix: add type-check script to @mana-core/nestjs-integration 2025-12-10 21:25:10 +01:00
manadeck-database fix(db): use TEXT for user_id columns across entire codebase 2025-12-09 16:30:51 +01:00
news-database fix(db): use TEXT for user_id columns across entire codebase 2025-12-09 16:30:51 +01:00
nutriphi-database improve code quality 2025-12-03 23:42:37 +01:00
shared-api-client Merge branch 'dev-1' into dev 2025-12-05 17:57:26 +01:00
shared-auth 🐛 fix(auth): require name field in registration forms 2025-12-16 20:28:28 +01:00
shared-auth-stores fix lint 2025-12-04 00:32:13 +01:00
shared-auth-ui 🐛 fix(auth): require name field in registration forms 2025-12-16 20:28:28 +01:00
shared-branding 🐛 fix: resolve auth issues in Manacore, Calendar, and Clock apps 2025-12-08 15:51:57 +01:00
shared-config fix lint 2025-12-04 00:32:13 +01:00
shared-credit-service fix lint 2025-12-04 00:32:13 +01:00
shared-errors Fix wrong type 2025-12-04 23:25:25 +01:00
shared-feedback-service fix lint 2025-12-04 00:32:13 +01:00
shared-feedback-types improve code quality 2025-12-03 23:42:37 +01:00
shared-feedback-ui chore: various UI improvements and fixes 2025-12-10 20:05:02 +01:00
shared-help-content feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
shared-help-mobile feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
shared-help-types feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
shared-help-ui feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
shared-i18n 🐛 fix(auth): require name field in registration forms 2025-12-16 20:28:28 +01:00
shared-icons improve code quality 2025-12-03 23:42:37 +01:00
shared-landing-ui improve code quality 2025-12-03 23:42:37 +01:00
shared-nestjs-auth feat(auth): add centralized @manacore/better-auth-types package 2025-12-16 02:43:55 +01:00
shared-nestjs-cors test(cors): add comprehensive unit tests for shared-nestjs-cors 2025-12-17 18:11:13 +01:00
shared-profile-ui improve code quality 2025-12-03 23:42:37 +01:00
shared-splitscreen ️ fix: resolve all svelte-check a11y warnings across web apps 2025-12-15 19:09:01 +01:00
shared-storage feat(storage): unified single-bucket architecture with Hetzner S3 2025-12-16 01:29:11 +01:00
shared-stores ♻️ refactor: unify web app patterns across monorepo 2025-12-05 03:35:26 +01:00
shared-subscription-types improve code quality 2025-12-03 23:42:37 +01:00
shared-subscription-ui improve code quality 2025-12-03 23:42:37 +01:00
shared-supabase Fix wrong type 2025-12-04 23:25:25 +01:00
shared-tags feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
shared-tailwind feat(ui): add elevation system for overlays and modals 2025-12-13 15:00:33 +01:00
shared-theme refactor(theme): remove custom theme editor and community themes 2025-12-12 02:34:43 +01:00
shared-theme-ui feat(shared-ui): add FilterDropdown export and InputBar FAB support 2025-12-14 21:32:03 +01:00
shared-types feat(contacts): integrate contacts into Todo and Calendar apps 2025-12-11 18:14:35 +01:00
shared-ui Merge branch 'dev' into till-dev 2025-12-16 19:17:07 +01:00
shared-utils feat: add unified CommandBar Quick-Create for Calendar and Contacts 2025-12-10 21:12:07 +01:00
shared-vite-config feat(splitscreen): add split-screen feature for multi-app side-by-side view 2025-12-12 13:00:26 +01:00
test-config improve code quality 2025-12-03 23:42:37 +01:00
uload-database fix(db): use TEXT for user_id columns across entire codebase 2025-12-09 16:30:51 +01:00