Skip to content

expand test coverage#4

Merged
malcolmbarrett merged 3 commits into
mainfrom
tests
Mar 21, 2026
Merged

expand test coverage#4
malcolmbarrett merged 3 commits into
mainfrom
tests

Conversation

@malcolmbarrett

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the package’s test coverage by adding new unit tests for core cause/component helpers and by introducing visual snapshot tests for causal_pie() / causal_pie_necessary() plots.

Changes:

  • Add additional testthat coverage for causify(), components(), necessary_causes(), and sufficient_causes().
  • Introduce vdiffr-based visual snapshot tests (with generated SVG snapshots) for plot outputs and themes.
  • Update DESCRIPTION to include vdiffr in Suggests.

Reviewed changes

Copilot reviewed 5 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test-components.R Adds test cases for necessary/sufficient cause helpers and components() behavior with/without U.
tests/testthat/test-causify.R Adds tests for fraction splitting logic, labeling format, and sequential U naming.
tests/testthat/test-causalpie.R Adds structural ggplot tests plus vdiffr visual snapshot coverage for pies, necessary pies, and themes.
tests/testthat/helper-vdiffr.R Adds a wrapper for vdiffr::expect_doppelganger() with skip logic.
tests/testthat/_snaps/causalpie/*.svg Adds vdiffr snapshot artifacts for plot rendering expectations.
DESCRIPTION Adds vdiffr to Suggests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/helper-vdiffr.R Outdated
Comment thread tests/testthat/test-causalpie.R
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@malcolmbarrett malcolmbarrett merged commit 520291c into main Mar 21, 2026
6 checks passed
@malcolmbarrett malcolmbarrett deleted the tests branch March 21, 2026 21:24
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.

2 participants