tests/testthat/test-S3-median.R

adat <- mock_adat()

test_that("the `median.soma_adat()` method trips correct warning", {
  expect_snapshot(median(adat))
})

test_that("the `median.soma_adat()` method invisibly returns `NULL`", {
  withr::local_options(list(warn = -1)) # turn off warnings tests
  expect_invisible(median(adat))
  expect_null(median(adat))
})

Try the SomaDataIO package in your browser

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

SomaDataIO documentation built on April 4, 2025, 2:14 a.m.