Running a limited number of Scala tests


Something that has driven me crazy since I started developing in Scala is that I haven’t been able to run only the test I just created in sbt. It was possible, of course, but I never Googled the correct search terms until recently.

Then I discovered that I can run a single Scala test using the testOnly method and it improves my work life greatly. No more waiting 10 minutes for a test run for just one test change!

Inside sbt, run
testOnly package.for.your.FileSpec
(replace with your Scala package and file name, of course).


Leave a Reply

Your email address will not be published. Required fields are marked *