Skip to content

Commit

Permalink
Revert "add snapshot tests"
Browse files Browse the repository at this point in the history
This reverts commit 862208e.
  • Loading branch information
gravesti committed Jul 18, 2024
1 parent 862208e commit 3867432
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 3,839 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ repos:
.*\.rds|
.*\.Rds|
.*\.sh|
.*\.RData|
.*\.svg
.*\.RData
)$
- id: lintr
- id: readme-rmd-rendered
Expand Down
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Suggests:
sandwich,
survminer,
flexsurv,
tibble,
vdiffr
tibble
VignetteBuilder:
knitr
biocViews:
Expand Down
1,772 changes: 0 additions & 1,772 deletions tests/testthat/_snaps/plot_km/kmplot2-all.svg

This file was deleted.

991 changes: 0 additions & 991 deletions tests/testthat/_snaps/plot_km/kmplot2-by-am.svg

This file was deleted.

991 changes: 0 additions & 991 deletions tests/testthat/_snaps/plot_km/kmplot2-by-trial.svg

This file was deleted.

81 changes: 0 additions & 81 deletions tests/testthat/test-plot_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,84 +22,3 @@ test_that("ph_diagplot_schoenfeld works without error", {
)
expect_equal(original_par, par())
})

test_that("kmplot2 works", {
skip_if_not_installed("vdiffr")

data(weighted_twt)
data(adtte_twt)
data(pseudo_ipd_twt)

# plot by trial
expect_warning(
vdiffr::expect_doppelganger(
title = "kmplot2_by_trial",
fig = function() {
kmplot2(
weights_object = weighted_twt,
tte_ipd = adtte_twt,
tte_pseudo_ipd = pseudo_ipd_twt,
trt_ipd = "A",
trt_agd = "B",
trt_common = "C",
trt_var_ipd = "ARM",
trt_var_agd = "ARM",
endpoint_name = "Overall Survival",
km_conf_type = "log-log",
km_layout = "by_trial",
time_scale = "month",
break_x_by = 2
)
}
),
"select_"
)



# plot by arm
vdiffr::expect_doppelganger(
title = "kmplot2_by_am",
fig = function() {
kmplot2(
weights_object = weighted_twt,
tte_ipd = adtte_twt,
tte_pseudo_ipd = pseudo_ipd_twt,
trt_ipd = "A",
trt_agd = "B",
trt_common = "C",
trt_var_ipd = "ARM",
trt_var_agd = "ARM",
endpoint_name = "Overall Survival",
km_conf_type = "log-log",
km_layout = "by_arm",
time_scale = "month",
break_x_by = 2
)
}
)

# plot all
vdiffr::expect_doppelganger(
title = "kmplot2_all",
fig = function() {
kmplot2(
weights_object = weighted_twt,
tte_ipd = adtte_twt,
tte_pseudo_ipd = pseudo_ipd_twt,
trt_ipd = "A",
trt_agd = "B",
trt_common = "C",
trt_var_ipd = "ARM",
trt_var_agd = "ARM",
endpoint_name = "Overall Survival",
km_conf_type = "log-log",
km_layout = "all",
time_scale = "month",
break_x_by = 2,
xlim = c(0, 20),
show_risk_set = FALSE
)
}
)
})

0 comments on commit 3867432

Please sign in to comment.