tests/testthat/test-historical.R

test_that("historical exchange rates check works", {

  skip_on_cran()
  skip_on_travis()
  skip_on_appveyor()

  x <- get_historical_exchange_rates("2021-01-01")

  expect_equal(class(x), "list")
  expect_equal(class(x$data$EUR$value), "numeric")

  y <- get_historical_exchange_rates("2021-01-01", "EUR")

  expect_equal(class(y), "list")
  expect_equal(class(y$data$USD$value), "numeric")

  z <- get_historical_exchange_rates("2021-01-01", "EUR", "AUD")

  expect_equal(class(z), "list")
  expect_equal(class(z$data$AUD$value), "numeric")

})

Try the currencyapi package in your browser

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

currencyapi documentation built on May 31, 2023, 8:56 p.m.