subugoe / hoad

Deprecated: Please check https://github.com/subugoe/hoaddash
https://github.com/subugoe/hoaddash
GNU Affero General Public License v3.0
15 stars 4 forks source link

find a better way to loop over entries in tests #218

Open maxheld83 opened 4 years ago

maxheld83 commented 4 years ago

we have quite a lot of objects where we have to run tests row-wise, because we have a lot of (small-ish) data objects such as license_patterns in the package, which we'd ideally test on every commit via testthat.

I've just done this crudely, like so:

test_that("urls are valid", {
  purrr::walk(
    .x = license_patterns,
    .f = function(x) {
      expect_list(httr::parse_url(x))
    }
  )
})

This works, but is a bit verbose and doesn't produce pretty errors.

Not urgent right now, but we should improve this at some point, because these tests and errors are probably going to keep us pretty busy 😏.