Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ VignetteBuilder:
knitr
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/build-site.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Package pkgdown site can be built

Code
build_site(path = "testPkgdown", override = list(destination = destination))
Message
-- Installing package testPkgdown into temporary library -----------------------
-- Finished building pkgdown site for package testPkgdown ----------------------

19 changes: 19 additions & 0 deletions tests/testthat/_snaps/check-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# check_man works

Code
check_man(pkg)
Message
i Updating {package} documentation
i Loading {package}
i Checking documentation...
Output
Rd files without \alias:
'foo.Rd'
Rd files without \description:
'foo.Rd'
Argument items with no description in Rd file 'foo.Rd':
'foo'
Undocumented arguments in Rd file 'foo.Rd'
'x'


39 changes: 8 additions & 31 deletions tests/testthat/test-build-site.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,13 @@ test_that("Package pkgdown site can be built ", {

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

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

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"
)
expect_true(file_exists(path(destination, "index.html")))
expect_true(file_exists(path(destination, "reference", "index.html")))
expect_true(file_exists(path(destination, "articles", "index.html")))
expect_true(file_exists(path(destination, "articles", "test.html")))
})
4 changes: 2 additions & 2 deletions tests/testthat/test-check-doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ foo(x)
file.path(pkg, "man", "foo.Rd")
)

expect_output(
expect_snapshot(
check_man(pkg),
"Undocumented arguments"
transform = \(x) gsub(basename(pkg), "{package}", x, fixed = TRUE)
)
})