Parameters

Initialize temporary folders in the working directory

tmp_01 <- util_make_subdir()
tmp_02 <- util_make_subdir()

Expect error

test_that("error", {
  expect_error(
    util_clean_dir(
      dir = "NONEXISTENT",
      create_dir = FALSE
    )
  )
})
#> Test passed 🌈

Clean up temporary files and folders

util_clean_dir(
  dir = tmp_01,
  create_dir = FALSE
)
util_clean_dir(
  dir = tmp_02,
  create_dir = FALSE
)