Error in `setwd(dir = new)`: cannot change working directory

if (fs::dir_exists(here::here("tests", "testthat", "testdata"))) {
pr_gpkg <- here::here("tests", "testthat", "testdata", "parana.gpkg") |>
test_that("write_gpkg.sdm_area - salvar arquivo com sf", {
sa <- sdm_area(pr_gpkg, cell_size = 50000, crs = 6933)
sa |> write_gpkg(file_path = ".", file_name = "parana")
test_that("write_gpkg.sdm_area - salvar arquivo com sf path invalido", {
sa |> write_gpkg(file_path = "parana.gpkg", file_name = "parana"),
sa |> write_gpkg(file_path = "/parana", file_name = "parana"),
test_that("write_gpkg.sdm_area - salvar arquivo com sf file path invalido", {
sa |> write_gpkg(file_path = "/tmp", file_name = 1),

"write_gpkg.sdm_area - salvar arquivo com sf"
"write_gpkg.sdm_area - salvar arquivo com sf path invalido"
"write_gpkg.sdm_area - salvar arquivo com sf file path invalido"

write_gpkg.sdm_area - salvar arquivo com sf

Error in `write_gpkg(sa, file_path = "/tmp", file_name = 1)`: x Assertion on file_path failed.
i Directory '/tmp' does not exist

write_gpkg.sdm_area - salvar arquivo com sf file path invalido