title: Printing custom diagnostic information if `testthat` test fails in `R`
body: <p>I use a <code>testthat</code> unit test to check whether the <code>data.frame</code> returned by a function is identical to the one I would expect it to return. If the test fails, <code>testthat</code> prints some diagnostic information, for instance:</p>
  
  <pre><code>MyFunction(df.orig) is not identical to df.expected. Differences: 
  Names: 1 string mismatch
  </code></pre>
  
  <p>However, I would really like to see the actual output of the function, i.e. print the returned <code>data.frame</code>. Is there a way to print the output of the tested function (or some other custom diagnostic information) if a <code>testthat</code> test fails?</p>