korrents

korrents · piece

Converting testthat Tests to testit

Yihui Xie · 15 May 2026 · yihui.org

3 korrents from this piece

Yihui Xie did not write this page.

Every claim below was made in this piece, quoted word for word and numbered in the order the piece makes them, so you can read it there rather than take our word for it. The sentence above each quote is our reading of the claim, not their wording. Each quote was checked against a stored copy of the page at build time; where the two differ, the quote is the fact.

  1. I still believe that unit testing should be nothing more than "tell me if something unexpected happened."
  2. The popularity feeds the tooling, and the tooling feeds the popularity. That's not a technical argument-it's a network effect.
  3. unless the code is completely out of your control, the need for mocking often indicates a design problem-consider refactoring to make the code easier to test directly.