tests/testthat/_snaps/standalone-defer.md

defer()'s global env facilities work

Code
  defer(print("howdy"), envir = globalenv())
Message
  Setting global deferred event(s).
  i These will be run:
    * Automatically, when the R session ends.
    * On demand, if you call `withr::deferred_run()`.
  i Use `withr::deferred_clear()` to clear them without executing.

don't need to enable source for the global env

Code
  source(file, local = globalenv())
Output
  1
  2
  deferred


jimhester/withr documentation built on Nov. 2, 2024, 12:58 a.m.