Skip to content

Commit

Permalink
Updates for testthat 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Oct 11, 2023
1 parent fbf5fe6 commit 29ae88d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 174 deletions.
8 changes: 4 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ references:
abstract: 'datawizard: Easy Data Wrangling and Statistical Transformations'
notes: Imports
url: https://easystats.github.io/datawizard/
repository: https://CRAN.R-project.org/package=datawizard
repository: https://easystats.r-universe.dev
authors:
- family-names: Patil
given-names: Indrajeet
Expand Down Expand Up @@ -447,8 +447,8 @@ references:
given-names: Indrajeet
email: [email protected]
orcid: https://orcid.org/0000-0003-1995-6531
year: '2023'
version: '>= 1.5.2.9000'
year: '2023'
- type: software
title: tidyr
abstract: 'tidyr: Tidy Messy Data'
Expand Down Expand Up @@ -696,7 +696,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2023'
version: '>= 3.1.10'
version: '>= 3.2.0'
- type: software
title: tibble
abstract: 'tibble: Simple Data Frames'
Expand Down Expand Up @@ -748,7 +748,7 @@ references:
given-names: Jim
- family-names: Henry
given-names: Lionel
email: lionel@rstudio.com
email: lionel@posit.co
- family-names: Müller
given-names: Kirill
email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Suggests:
psych,
rmarkdown,
survival,
testthat (>= 3.1.10),
testthat (>= 3.2.0),
tibble,
vdiffr (>= 1.0.7),
withr,
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"version": ">= 3.1.10",
"version": ">= 3.2.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -525,7 +525,7 @@
},
"SystemRequirements": null
},
"fileSize": "9422.075KB",
"fileSize": "9388.713KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggcoefstats.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The tidy data frame *must* contain 'estimate' column.

# edge cases
# works when CIs unavailable

Elements in `term` column must be unique.

140 changes: 0 additions & 140 deletions tests/testthat/_snaps/ggcoefstats/nas-in-numeric-columns.svg

This file was deleted.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Code
.is_palette_sufficient("RColorBrewer", "Dark2", 20L)
Message <rlang_message>
Message
Number of labels is greater than default palette color count.
* Select another color `palette` (and/or `package`).
Output
Expand Down
13 changes: 13 additions & 0 deletions tests/testthat/helper-state.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
testthat::set_state_inspector(function() {
list(
attached = search(),
connections = nrow(showConnections()),
cwd = getwd(),
envvars = Sys.getenv(),
libpaths = .libPaths(),
locale = Sys.getlocale(),
options = .Options,
packages = .packages(all.available = TRUE),
NULL
)
})
26 changes: 1 addition & 25 deletions tests/testthat/test-ggcoefstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,31 +131,7 @@ test_that(
# edge cases -------------------------------------

test_that(
desc = "missing values in numeric columns",
code = {
skip_if_not_installed("lme4")
skip_on_os(c("windows", "linux", "solaris"))

withr::local_package("lme4")
m_lmer <- ggcoefstats(
lme4::lmer(Reaction ~ Days + (Days | Subject),
data = lme4::sleepstudy
)
)

expect_s3_class(m_lmer, "ggplot")

skip_on_os("mac", c("i386", "x86_64"))
set.seed(123)
expect_doppelganger(
title = "NAs in numeric columns",
fig = m_lmer
)
}
)

test_that(
desc = "edge cases",
desc = "works when CIs unavailable",
code = {
set.seed(123)
df_base <- tidy_model_parameters(stats::lm(wt ~ am * cyl, mtcars))
Expand Down

0 comments on commit 29ae88d

Please sign in to comment.