Skip to content

@hadley hadley released this May 22, 2015 · 957 commits to master since this release

  • Failure locations are now formated as R error locations.
  • Deprecated library_if_available() has been removed.
  • test (test_dir(), test_file(), test_package(), test_check()) functions
    now return a testthat_results object that contains all results, and can be
    printed or converted to data frame.
  • test_dir(), test_package(), and test_check() have an added ...
    argument that allows filtering of test files using, e.g., Perl-style regular
    expressions,or fixed character filtering. Arguments in ... are passed to
    grepl() (@leeper).
  • test_check() uses a new reporter specifically designed for R CMD check.
    It displays a summary at the end of the tests, designed to be <13 lines long
    so test failures in R CMD check display something more useful. This will
    hopefully stop BDR from calling testthat a "test obfuscation suite" (#201).
  • compare() is now documented and exported. Added a numeric method so when
    long numeric vectors don't match you'll see some examples of where the
    problem is (#177). The line spacing in compare.character() was
    tweaked.
  • skip_if_not_installed() skips tests if a package isn't installed (#192).
  • expect_that(a, equals(b)) style of testing has been soft-deprecated.
    It will keep working, but it's no longer demonstrated any where, and new
    expectations will only be available in expect_equal(a, b) style. (#172)
  • Once again, testthat suppresses messages and warnings in tests (#189)
  • New test_examples() lets you run package examples as tests. Each example
    counts as one expectation and it succeeds if the code runs without errors
    (#204).
  • New succeed() expectation always succeeds.
  • skip_on_travis() allows you to skip tests when run on Travis CI.
    (Thanks to @mllg)
  • colourise() was removed. (Colour is still supported, via the crayon
    package.)
  • Mocks can now access values local to the call of with_mock (#193, @krlmlr).
  • All equality expectations are now documented together (#173); all
    matching expectations are also documented together.
Assets 2
You can’t perform that action at this time.