Skip to content

Commit 083d338

Browse files
committed
use skip_if_not_installed("vdiffr")
1 parent 0a9e235 commit 083d338

11 files changed

+36
-0
lines changed

tests/testthat/test-aesthetics.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ color_scheme_set()
208208

209209
test_that("color_scheme_view renders correctly", {
210210
testthat::skip_on_cran()
211+
testthat::skip_if_not_installed("vdiffr")
211212

212213
color_scheme_set()
213214
p_default <- color_scheme_view()

tests/testthat/test-mcmc-diagnostics.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ test_that("mcmc_acf & mcmc_acf_bar throw correct errors", {
104104

105105
test_that("mcmc_rhat renders correctly", {
106106
testthat::skip_on_cran()
107+
testthat::skip_if_not_installed("vdiffr")
107108

108109
rhats <- seq(from = 1, to = 1.20, length.out = 10)
109110

@@ -116,6 +117,7 @@ test_that("mcmc_rhat renders correctly", {
116117

117118
test_that("mcmc_rhat_hist renders correctly", {
118119
testthat::skip_on_cran()
120+
testthat::skip_if_not_installed("vdiffr")
119121

120122
rhats <- seq(from = 1, to = 1.20, length.out = 10)
121123

@@ -129,6 +131,7 @@ test_that("mcmc_rhat_hist renders correctly", {
129131

130132
test_that("mcmc_neff renders correctly", {
131133
testthat::skip_on_cran()
134+
testthat::skip_if_not_installed("vdiffr")
132135

133136
neffs <- seq(from = 0, to = 1, length.out = 20)
134137

@@ -138,6 +141,7 @@ test_that("mcmc_neff renders correctly", {
138141

139142
test_that("mcmc_neff_hist renders correctly", {
140143
testthat::skip_on_cran()
144+
testthat::skip_if_not_installed("vdiffr")
141145

142146
neffs <- seq(from = 0, to = 1, length.out = 20)
143147

tests/testthat/test-mcmc-distributions.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,13 @@ test_that("mcmc_* throws error if 1 chain but multiple chains required", {
106106
expect_error(mcmc_violin(arr1chain), "requires multiple chains")
107107
})
108108

109+
110+
111+
# Visual tests ------------------------------------------------------------
112+
109113
test_that("mcmc_hist renders correctly", {
110114
testthat::skip_on_cran()
115+
testthat::skip_if_not_installed("vdiffr")
111116

112117
p_base <- mcmc_hist(vdiff_dframe)
113118
vdiffr::expect_doppelganger("mcmc_hist (default)", p_base)

tests/testthat/test-mcmc-intervals.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ test_that("inconsistent probabilities raise warning (#138)", {
177177

178178
test_that("mcmc_intervals renders correctly", {
179179
testthat::skip_on_cran()
180+
testthat::skip_if_not_installed("vdiffr")
180181

181182
p_base <- mcmc_intervals(vdiff_dframe)
182183
vdiffr::expect_doppelganger("mcmc_intervals (default)", p_base)
@@ -200,6 +201,7 @@ test_that("mcmc_intervals renders correctly", {
200201

201202
test_that("mcmc_areas renders correctly", {
202203
testthat::skip_on_cran()
204+
testthat::skip_if_not_installed("vdiffr")
203205

204206
p_base <- mcmc_areas(vdiff_dframe)
205207
vdiffr::expect_doppelganger("mcmc_areas (default)", p_base)
@@ -229,6 +231,7 @@ test_that("mcmc_areas renders correctly", {
229231

230232
test_that("mcmc_areas_ridges renders correctly", {
231233
testthat::skip_on_cran()
234+
testthat::skip_if_not_installed("vdiffr")
232235

233236
p_base <- mcmc_areas_ridges(vdiff_dframe)
234237
vdiffr::expect_doppelganger("mcmc_areas_ridges (default)", p_base)

tests/testthat/test-mcmc-traces.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ test_that("mcmc_trace 'np' argument works", {
9898

9999
test_that("mcmc_trace renders correctly", {
100100
testthat::skip_on_cran()
101+
testthat::skip_if_not_installed("vdiffr")
101102

102103
p_base <- mcmc_trace(vdiff_dframe_chains, pars = c("V1", "V2"))
103104
p_one_param <- mcmc_trace(vdiff_dframe_chains, pars = "V1")

tests/testthat/test-ppc-discrete.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ test_that("ppc_rootogram errors if y/yrep not counts", {
7171
# Visual tests ------------------------------------------------------------
7272
test_that("ppc_bars renders correctly", {
7373
testthat::skip_on_cran()
74+
testthat::skip_if_not_installed("vdiffr")
7475

7576
p_base <- ppc_bars(vdiff_y2, vdiff_yrep2)
7677
vdiffr::expect_doppelganger("ppc_bars (default)", p_base)
@@ -103,6 +104,7 @@ test_that("ppc_bars renders correctly", {
103104

104105
test_that("ppc_bars_grouped renders correctly", {
105106
testthat::skip_on_cran()
107+
testthat::skip_if_not_installed("vdiffr")
106108

107109
p_base <- ppc_bars_grouped(vdiff_y2, vdiff_yrep2, vdiff_group2)
108110
vdiffr::expect_doppelganger("ppc_bars_grouped (default)", p_base)
@@ -123,6 +125,7 @@ test_that("ppc_bars_grouped renders correctly", {
123125

124126
test_that("ppc_rootogram renders correctly", {
125127
testthat::skip_on_cran()
128+
testthat::skip_if_not_installed("vdiffr")
126129

127130
p_base <- ppc_rootogram(vdiff_y2, vdiff_yrep2)
128131
vdiffr::expect_doppelganger("ppc_rootogram (default)", p_base)

tests/testthat/test-ppc-distributions.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ test_that("ppc_violin_grouped returns a ggplot object", {
6161

6262
test_that("ppc_hist renders correctly", {
6363
testthat::skip_on_cran()
64+
testthat::skip_if_not_installed("vdiffr")
6465

6566
p_base <- ppc_hist(vdiff_y, vdiff_yrep[1:8, ])
6667
vdiffr::expect_doppelganger("ppc_hist (default)", p_base)
@@ -71,6 +72,7 @@ test_that("ppc_hist renders correctly", {
7172

7273
test_that("ppc_freqpoly renders correctly", {
7374
testthat::skip_on_cran()
75+
testthat::skip_if_not_installed("vdiffr")
7476

7577
p_base <- ppc_freqpoly(vdiff_y, vdiff_yrep[1:8, ])
7678
vdiffr::expect_doppelganger("ppc_freqpoly (default)", p_base)
@@ -89,13 +91,15 @@ test_that("ppc_freqpoly renders correctly", {
8991

9092
test_that("ppc_freqpoly_grouped renders correctly", {
9193
testthat::skip_on_cran()
94+
testthat::skip_if_not_installed("vdiffr")
9295

9396
p_base <- ppc_freqpoly_grouped(vdiff_y, vdiff_yrep[1:3, ], vdiff_group)
9497
vdiffr::expect_doppelganger("ppc_freqpoly_grouped (default)", p_base)
9598
})
9699

97100
test_that("ppc_boxplot renders correctly", {
98101
testthat::skip_on_cran()
102+
testthat::skip_if_not_installed("vdiffr")
99103

100104
p_base <- ppc_boxplot(vdiff_y, vdiff_yrep[1:8, ])
101105
vdiffr::expect_doppelganger("ppc_boxplot (default)", p_base)
@@ -109,6 +113,7 @@ test_that("ppc_boxplot renders correctly", {
109113

110114
test_that("ppc_ecdf_overlay renders correctly", {
111115
testthat::skip_on_cran()
116+
testthat::skip_if_not_installed("vdiffr")
112117

113118
p_base <- ppc_ecdf_overlay(vdiff_y2, vdiff_yrep2)
114119
vdiffr::expect_doppelganger("ppc_ecdf_overlay (default)", p_base)
@@ -124,13 +129,15 @@ test_that("ppc_ecdf_overlay renders correctly", {
124129

125130
test_that("ppc_dens renders correctly", {
126131
testthat::skip_on_cran()
132+
testthat::skip_if_not_installed("vdiffr")
127133

128134
p_base <- ppc_dens(vdiff_y, vdiff_yrep[1:8, ])
129135
vdiffr::expect_doppelganger("ppc_dens (default)", p_base)
130136
})
131137

132138
test_that("ppc_dens_overlay renders correctly", {
133139
testthat::skip_on_cran()
140+
testthat::skip_if_not_installed("vdiffr")
134141

135142
p_base <- ppc_dens_overlay(vdiff_y, vdiff_yrep)
136143
vdiffr::expect_doppelganger("ppc_dens_overlay (default)", p_base)
@@ -142,6 +149,7 @@ test_that("ppc_dens_overlay renders correctly", {
142149
test_that("ppc_violin_grouped renders correctly", {
143150
testthat::skip_on_cran()
144151
testthat::skip_if_not(getRversion() >= "3.6.0")
152+
testthat::skip_if_not_installed("vdiffr")
145153

146154
p_base <- ppc_violin_grouped(vdiff_y, vdiff_yrep, vdiff_group)
147155
vdiffr::expect_doppelganger("ppc_violin_grouped (default)", p_base)

tests/testthat/test-ppc-errors.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ test_that("bin_errors works for edge cases", {
6363

6464
test_that("ppc_error_binned renders correctly", {
6565
testthat::skip_on_cran()
66+
testthat::skip_if_not_installed("vdiffr")
6667

6768
rbeta2 <- function(n, mu, phi) {
6869
a <- mu * phi

tests/testthat/test-ppc-intervals.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ test_that("ppc_intervals_data does math correctly", {
8787

8888
test_that("ppc_intervals renders correctly", {
8989
testthat::skip_on_cran()
90+
testthat::skip_if_not_installed("vdiffr")
9091

9192
p_base <- ppc_intervals(vdiff_y, vdiff_yrep)
9293
vdiffr::expect_doppelganger("ppc_intervals (default)", p_base)
@@ -100,6 +101,7 @@ test_that("ppc_intervals renders correctly", {
100101

101102
test_that("ppc_intervals_grouped renders correctly", {
102103
testthat::skip_on_cran()
104+
testthat::skip_if_not_installed("vdiffr")
103105

104106
p_base <- ppc_intervals_grouped(vdiff_y, vdiff_yrep, group = vdiff_group)
105107
vdiffr::expect_doppelganger("ppc_intervals_grouped (default)", p_base)
@@ -114,6 +116,7 @@ test_that("ppc_intervals_grouped renders correctly", {
114116

115117
test_that("ppc_ribbon renders correctly", {
116118
testthat::skip_on_cran()
119+
testthat::skip_if_not_installed("vdiffr")
117120

118121
p_base <- ppc_ribbon(vdiff_y, vdiff_yrep)
119122
vdiffr::expect_doppelganger("ppc_ribbon (default)", p_base)

tests/testthat/test-ppc-scatterplots.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test_that("ppc_scatter_avg_grouped returns a ggplot object", {
3636

3737
test_that("ppc_scatter renders correctly", {
3838
testthat::skip_on_cran()
39+
testthat::skip_if_not_installed("vdiffr")
3940

4041
p_base <- ppc_scatter(vdiff_y, vdiff_yrep[1:6, ])
4142
vdiffr::expect_doppelganger("ppc_scatter (default)", p_base)
@@ -54,6 +55,7 @@ test_that("ppc_scatter renders correctly", {
5455

5556
test_that("ppc_scatter_avg renders correctly", {
5657
testthat::skip_on_cran()
58+
testthat::skip_if_not_installed("vdiffr")
5759

5860
p_base <- ppc_scatter_avg(vdiff_y, vdiff_yrep)
5961
vdiffr::expect_doppelganger("ppc_scatter_avg (default)", p_base)
@@ -72,6 +74,7 @@ test_that("ppc_scatter_avg renders correctly", {
7274

7375
test_that("ppc_scatter_avg_grouped renders correctly", {
7476
testthat::skip_on_cran()
77+
testthat::skip_if_not_installed("vdiffr")
7578

7679
p_base <- ppc_scatter_avg_grouped(vdiff_y, vdiff_yrep, vdiff_group)
7780
vdiffr::expect_doppelganger("ppc_scatter_avg_grouped (default)", p_base)

0 commit comments

Comments
 (0)