File: test-report.R

package info (click to toggle)
r-cran-covr 3.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 984 kB
  • sloc: javascript: 238; cpp: 54; ansic: 48; xml: 41; sh: 18; makefile: 11
file content (29 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
context("report")

skip_on_ci <- function() {
  if (!identical(Sys.getenv("CI"), "true")) {
    return(invisible(TRUE))
  }

  skip("On CI")
}

#test_that("it works with coverage objects", {
  #skip_on_cran()
  #skip_on_ci()

  #tmp <- tempfile()
  #set.seed(42)
  #cov <- package_coverage("TestS4")
  ## Shiny uses its own seed which is not affected by set.seed, so we need to
  ## set that as well to have reproducibility
  #g <- shiny:::.globals
  #g$ownSeed <- .Random.seed
  #htmlwidgets::setWidgetIdSeed(42)
  #report(cov, file = tmp, browse = FALSE)
  #simplify_link <- function(x) {
    #rex::re_substitutes(x,
      #rex::rex(capture(or("src", "href")), "=", quote, non_quotes, quote), "\\1=\"\">")
  #}
  #expect_equal(simplify_link(readLines(tmp)), simplify_link(readLines("test-report.htm")))
#})