File: test-build-site.R

package info (click to toggle)
r-cran-devtools 2.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,328 kB
  • sloc: sh: 15; makefile: 5
file content (33 lines) | stat: -rw-r--r-- 933 bytes parent folder | download
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
30
31
32
33
test_that("Package pkgdown site can be built ", {
  # This test requires internet
  skip_if_offline()
  skip_on_cran()

  destination <- path(tempdir(), "testPkgdown", "docs")

  build_output <- capture.output({
    build_site(
      path = "testPkgdown",
      override = list(destination = destination)
    )
  }, type = c("output"))

  build_output <- paste(build_output, collapse = "\n")

  expect_true(file_exists(path(destination, "index.html")),
    info = build_output,
    label = "created site index"
  )
  expect_true(file_exists(path(destination, "reference", "index.html")),
    info = build_output,
    label = "created reference index"
  )
  expect_true(file_exists(path(destination, "articles", "index.html")),
    info = build_output,
    label = "created articles index"
  )
  expect_true(file_exists(path(destination, "articles", "test.html")),
    info = build_output,
    label = "created articles index"
  )
})