Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 18, 2023
1 parent d0332db commit 509d46a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/testthat/_snaps/describe_distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
-----------------------------------------------------------
| | [VC, OJ] | 0 | -2.07 | 60 | 0

# describe_distribution formatting

Code
format(x)
Output
Mean | SD | IQR | Range | Quartiles | Skewness | Kurtosis | n | n_Missing
--------------------------------------------------------------------------------------
3.06 | 0.44 | 0.52 | [2.00, 4.40] | 2.80, 3.30 | 0.32 | 0.23 | 150 | 0

8 changes: 7 additions & 1 deletion tests/testthat/test-describe_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ test_that("describe_distribution - grouped df", {


# distribution_mode --------------------------

test_that("distribution_mode works as expected", {
skip_if_not_installed("bayestestR")

Expand Down Expand Up @@ -279,3 +278,10 @@ test_that("describe_distribution regex", {
ignore_attr = TRUE
)
})

# formatting ------------------------------
test_that("describe_distribution formatting", {
data(iris)
x <- describe_distribution(iris$Sepal.Width, quartiles = TRUE)
expect_snapshot(format(x))
})

0 comments on commit 509d46a

Please sign in to comment.