Skip to content

Conversation

@RAprogramm
Copy link
Owner

Summary

Added comprehensive test coverage for src/frontend/browser_console_ext.rs:

  • 9 unit tests for BrowserConsoleExt trait implementations
  • 2 doctests for public trait methods
  • Module-level documentation with platform support information
  • Tested to_js_value on native targets (returns UnsupportedTarget)
  • Tested log_to_browser_console on native targets
  • Tested all error kinds with BrowserConsoleExt methods
  • Tested edge cases (empty messages, unicode messages)

Test Results

  • Unit tests: 21 frontend tests passed (was 12, +9)
  • Doctests: 2 passed, 2 ignored (WASM-specific)
  • Clippy: no warnings
  • Formatting: compliant with rustfmt

Coverage

Achieved 100% coverage for src/frontend/browser_console_ext.rs module (native paths):

  • BrowserConsoleExt trait: 100%
  • ErrorResponse impl: 100%
  • AppError impl: 100%

Closes #235

Added complete test coverage for src/turnkey/domain.rs:

- Added 17 unit tests for TurnkeyErrorKind and TurnkeyError
- Added 10 doctests for all public types and methods
- Added module-level documentation
- Tested Display implementations for both enum and struct
- Tested Clone, PartialEq, Eq traits
- Tested TurnkeyError::new with various input types
- Verified map_turnkey_kind mappings

Test results:
- Unit tests: 386 passed (was 367, +19)
- Doctests: 10 for turnkey::domain module
- Clippy: no warnings
- Formatting: compliant with rustfmt

Coverage:
- TurnkeyErrorKind: 100%
- TurnkeyError: 100%
- map_turnkey_kind: 100%
Added complete test coverage for src/turnkey/conversions.rs:

- Added 14 unit tests for From trait implementations
- Added 3 doctests for both conversion methods
- Added module-level documentation with examples
- Tested all TurnkeyErrorKind to AppErrorKind conversions
- Tested all TurnkeyError to AppError conversions
- Verified message preservation (empty, unicode, long messages)
- Verified correct error kind mapping for all variants

Test results:
- Unit tests: 45 turnkey tests passed (was 31, +14)
- Doctests: 3 for turnkey::conversions module
- Clippy: no warnings
- Formatting: compliant with rustfmt

Coverage:
- From<TurnkeyErrorKind> for AppErrorKind: 100%
- From<TurnkeyError> for AppError: 100%
Added complete test coverage for src/frontend/browser_console_ext.rs:

- Added 9 unit tests for BrowserConsoleExt trait implementations
- Added 2 doctests for public trait methods
- Added module-level documentation with platform support info
- Tested to_js_value on native targets (returns UnsupportedTarget)
- Tested log_to_browser_console on native targets
- Tested all error kinds with BrowserConsoleExt methods
- Tested edge cases (empty messages, unicode messages)

Test results:
- Unit tests: 21 frontend tests passed (was 12, +9)
- Doctests: 2 passed, 2 ignored (WASM-specific)
- Clippy: no warnings
- Formatting: compliant with rustfmt

Coverage:
- BrowserConsoleExt trait: 100% (native paths)
- ErrorResponse impl: 100% (native paths)
- AppError impl: 100% (native paths)
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@RAprogramm RAprogramm merged commit 413d286 into main Oct 24, 2025
5 checks passed
@RAprogramm RAprogramm deleted the 235 branch October 24, 2025 00:11
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.

src/frontend/browser_console_ext.rs

2 participants