See a quick overview of ScalaTest, Specs2, Munit, uTest, and Minitest on the same test example to see how each framework and library handles unit testing.

If you are confused by the variety of test libraries in the Scala ecosystem like me, then this is the article for you.

In this article, I’d like to do a quick tour of Scala frameworks and libs and show the capabilities of each of them on the same example to compare their approaches and how the final test will look at a very high level.

IMPORTANT NOTES:

  • This article doesn’t cover tests for particular technologies like akkaPlay Frameworkcats-effect — only general-purpose unit testing technologies — but they will be mentioned in the end in a short wrap-up table.
  • Perhaps not all features of every testing library will be covered, but rather main functionality, like test structure, assertions, and test result matches.
  • ScalaCheck is not considered a separate library for testing in the scope of this post because the majority of libs have integration with it and ScalaCheck by itself does not provide all the necessary infrastructure to run tests, just the core logic.

#java #testing #scala

Testing With Scala: Library Landscape
1.85 GEEK