feat: add tests and assert coverage #71

Merged
naomi merged 7 commits from feat/testy into main 2026-01-26 00:26:04 -08:00
Owner

Explanation

No response

Issue

No response

Attestations

Dependencies

  • I have pinned the dependencies to a specific patch version.

Style

  • I have run the linter and resolved any errors.
  • My pull request uses an appropriate title, matching the conventional commit standards.
  • My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

Tests

  • My contribution adds new code, and I have added tests to cover it.
  • My contribution modifies existing code, and I have updated the tests to reflect these changes.
  • All new and existing tests pass locally with my changes.
  • Code coverage remains at or above the configured threshold.

Documentation

No response

Versioning

No response

### Explanation _No response_ ### Issue _No response_ ### Attestations - [ ] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [ ] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [ ] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [ ] I have pinned the dependencies to a specific patch version. ### Style - [ ] I have run the linter and resolved any errors. - [ ] My pull request uses an appropriate title, matching the conventional commit standards. - [ ] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [ ] My contribution adds new code, and I have added tests to cover it. - [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [ ] All new and existing tests pass locally with my changes. - [ ] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning _No response_
naomi added 4 commits 2026-01-25 23:18:48 -08:00
Backend (177 new tests):
- achievements.rs: 108 tests covering all achievement categories, unlock logic,
  serialization, and progress tracking
- commands.rs: 19 tests for validate_directory, get_file_size, and struct serialization
- git.rs: 31 tests with real temporary git repos for status, diff, stage, commit, log
- clipboard.rs: 19 tests for ClipboardEntry, ClipboardHistory, sorting, and filtering

Frontend (141 new tests):
- stats.test.ts: 19 tests for stats store and formattedStats derived store
- config.test.ts: 40 tests for theme, font size, path masking, and config store
- slashCommands.test.ts: 48 tests for parseSlashCommand, getMatchingCommands, isSlashCommand
- notifications.test.ts: 34 tests for NotificationType, NOTIFICATION_SOUNDS, SoundPlayer

Total test count increased from ~55 to 373 tests (216 backend + 157 frontend)
- Add @vitest/coverage-v8 for frontend test coverage
- Configure vitest with coverage thresholds (15% statements/lines, 13% branches/functions)
- Add npm scripts for backend testing and coverage with cargo-llvm-cov
- Add test:all and coverage:all scripts for unified test execution
- Exclude coverage directory from git tracking
- Run frontend tests with coverage thresholds (15% lines/statements)
- Add llvm-tools-preview component for Rust coverage
- Install cargo-llvm-cov and enforce 50% line coverage for backend
- CI will now fail if coverage drops below thresholds
test: expand test coverage for backend and frontend modules
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 58s
CI / Lint & Test (pull_request) Failing after 5m51s
CI / Build Linux (pull_request) Has been skipped
CI / Build Windows (cross-compile) (pull_request) Has been skipped
8cb4c17dc1
- Add 25+ tests for temp_manager.rs (0% -> 96.59% coverage)
- Expand sessions.rs tests (23% -> 68.50% coverage)
- Expand quick_actions.rs tests (23% -> 71.13% coverage)
- Expand snippets.rs tests (23% -> 72.32% coverage)
- Expand stats.rs tests with cost calculation and streak tests
- Add frontend test infrastructure with Tauri mocks
- Add tests for conversations, quickActions, and snippets stores
- Total backend tests: 298 passing
naomi added 1 commit 2026-01-25 23:28:52 -08:00
style: fix lint errors in test files
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 53s
CI / Lint & Test (pull_request) Failing after 5m54s
CI / Build Linux (pull_request) Has been skipped
CI / Build Windows (cross-compile) (pull_request) Has been skipped
d3bb62210d
- Remove unused imports in config.test.ts and conversations.test.ts
- Remove unused handler variable in tauri.test.ts
- Remove unused _args parameter in vitest.setup.ts mock
- Add coverage/ to eslint ignore list
naomi added 1 commit 2026-01-25 23:35:29 -08:00
chore: format
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 54s
CI / Lint & Test (pull_request) Failing after 5m52s
CI / Build Linux (pull_request) Has been skipped
CI / Build Windows (cross-compile) (pull_request) Has been skipped
be25152eea
naomi added 1 commit 2026-01-25 23:48:59 -08:00
style: fix strict clippy and TypeScript type errors
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 56s
CI / Lint & Test (pull_request) Successful in 15m50s
CI / Build Linux (pull_request) Successful in 19m46s
CI / Build Windows (cross-compile) (pull_request) Successful in 29m28s
1f5f95c8f3
- Fix assertions on constants in clipboard.rs (use const blocks)
- Fix unnecessary unwrap after is_ok check in git.rs
- Remove redundant u64 >= 0 comparison in stats.rs
- Add #[allow(clippy::useless_vec)] to sorting tests
- Add missing beforeEach import to vitest.setup.ts
- Change global.Audio to globalThis.Audio in notifications.test.ts
- Add type annotations to fix null type narrowing in conversations.test.ts
naomi merged commit b3d79a82ef into main 2026-01-26 00:26:04 -08:00
naomi deleted branch feat/testy 2026-01-26 00:26:05 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#71