Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 22, 2025

This PR significantly improves the test coverage of the report package by adding comprehensive tests for utility functions and helper methods that were previously undertested.

Coverage Improvements

The test suite has been expanded from 534 to 626 tests (92 new tests added), targeting specific files that had low coverage:

Enhanced Files

utils_grouped_df.R (was 13.56% coverage)

  • Added comprehensive tests for grouped dataframe utilities including .group_indices(), .groups_drop(), and .calculate_groups()
  • Covered factor handling, edge cases, and error conditions
  • Tests now validate proper grouped dataframe manipulation across different dplyr versions

format_model.R (was 46.15% coverage)

  • Enhanced tests for format_model.character() method with all supported model types
  • Added comprehensive testing for model type detection via get_model_type_prefix()
  • Covered edge cases for different GLM families, link functions, and model characteristics

report_table.R (was 54.24% coverage)

  • Added extensive tests for as.report_table() methods with summary and as_is parameters
  • Tested table concatenation functionality via c.report_table()
  • Enhanced coverage for .report_table_footer() and .report_table_caption() helper functions
  • Added edge cases for different statistical test output formatting

report_effectsize.R (was 68.97% coverage)

  • Created dedicated test file test-report_effectsize_helpers.R for helper functions
  • Complete coverage for .text_effectsize() with all interpretation methods (Cohen, Gignac, Funder, etc.)
  • Comprehensive testing for .text_standardize() covering all standardization methods (refit, 2sd, smart, basic, posthoc)
  • Enhanced testing for as.report_effectsize() and print methods

report_s.R (was 93.33% coverage)

  • Added enhanced edge case testing for S-value and p-value conversions
  • Improved parameter validation coverage including custom test parameters
  • Enhanced error handling scenarios for invalid inputs

Implementation Details

All tests follow existing repository conventions and focus on:

  • Untested code paths and edge cases
  • Error handling and parameter validation
  • Helper functions and internal methods
  • Backward compatibility preservation

The changes include appropriate version bumping (0.6.1.6 → 0.6.1.7) and NEWS.md documentation.

Testing

All 626 tests pass successfully with no regressions. The improvements provide robust validation of utility functions while maintaining full backward compatibility.

Fixes #559.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits September 22, 2025 03:09
Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
Copilot AI changed the title [WIP] [Task]: Increase project coverage Improve test coverage by adding comprehensive tests for utility functions and helpers Sep 22, 2025
Copilot AI requested a review from rempsyc September 22, 2025 03:15
Copilot finished work on behalf of rempsyc September 22, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Increase project coverage

2 participants