Skip to content

feat: add Jest setup and governance smoke test suites#5

Merged
moyunzero merged 1 commit into
masterfrom
250509-feat-governance-smoke-tests
May 9, 2026
Merged

feat: add Jest setup and governance smoke test suites#5
moyunzero merged 1 commit into
masterfrom
250509-feat-governance-smoke-tests

Conversation

@moyunzero
Copy link
Copy Markdown
Owner

  • Install jest@29, ts-jest@29, @types/jest@29 as devDependencies
  • Add Jest config to package.json (ts-jest preset, node env, @/ alias)
  • tests/unit/store/storage.test.ts (20 tests) covers getStorageKey, mergeEntries (3 strategies), loadFromStorage, saveToStorage, removeFromStorage, migrateFromLegacyStorage, migrateGuestDataToUser
  • tests/unit/utils/reviewExportDerived.test.ts (11 tests) covers computeReviewExportDerivedState: period stats, companion days, weather lines, monthly series, delta rate
  • tests/unit/utils/reviewExportClosingInput.test.ts (8 tests) covers buildReviewExportClosingSummary incl. normalizeFirstEntryDate edge cases (0, negative, valid)
  • tests/unit/store/syncStatus.test.ts (7 tests) covers sync state machine: idle→syncing→idle, error path, concurrent→pending
  • tests/unit/store/pendingSyncQueue.test.ts (7 tests) covers debounce merge behavior of pending sync queue

All 3 smoke paths pass: record | export | sync

- Install jest@29, ts-jest@29, @types/jest@29 as devDependencies
- Add Jest config to package.json (ts-jest preset, node env, @/ alias)
- __tests__/unit/store/storage.test.ts (20 tests)
  covers getStorageKey, mergeEntries (3 strategies), loadFromStorage,
  saveToStorage, removeFromStorage, migrateFromLegacyStorage,
  migrateGuestDataToUser
- __tests__/unit/utils/reviewExportDerived.test.ts (11 tests)
  covers computeReviewExportDerivedState: period stats, companion days,
  weather lines, monthly series, delta rate
- __tests__/unit/utils/reviewExportClosingInput.test.ts (8 tests)
  covers buildReviewExportClosingSummary incl. normalizeFirstEntryDate
  edge cases (0, negative, valid)
- __tests__/unit/store/syncStatus.test.ts (7 tests)
  covers sync state machine: idle→syncing→idle, error path, concurrent→pending
- __tests__/unit/store/pendingSyncQueue.test.ts (7 tests)
  covers debounce merge behavior of pending sync queue

All 3 smoke paths pass: record | export | sync
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

@moyunzero moyunzero merged commit dddb89b into master May 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant