tests/testthat/helper-async.R

expect_promise <- function(x, value, status = NULL) {
  expect_true(inherits(x, "promise"))

  if (!missing(value)) {
    expect_equal(prom_value(x), value)
  }
  if (!is_null(status)) {
    expect_equal(prom_status(x), status)
  }
}

Try the coro package in your browser

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

coro documentation built on July 19, 2022, 5:06 p.m.