tests/interactive/test-job.R

# Test both in RStudio and the terminal.
tar_test("tar_make(as_job = TRUE)", {
  tar_script({
    list(
      tar_target(x, 1),
      tar_target(y, x)
    )
  })
  tar_make(names = any_of("x"), as_job = TRUE)
  Sys.sleep(5)
  expect_equal(tar_outdated(), "y")
})

Try the targets package in your browser

Any scripts or data that you put into this service are public.

targets documentation built on June 22, 2024, 9:43 a.m.