---
title: "Live Unit Testing with sbt: Real-Time Test Execution for Scala Development"
description: "Can I have the coolest Visual Studio feature in IntelliJ?"
author: "Bartosz Mikulski"
author_bio: "Principal AI Engineer & MLOps Architect. I bridge the gap between \"it works in a notebook\" and \"it works for 200 million users.\""
author_url: https://mikulskibartosz.name
author_linkedin: https://www.linkedin.com/in/mikulskibartosz/
author_github: https://github.com/mikulskibartosz
canonical_url: https://mikulskibartosz.name/live-unit-testing-with-sbt
---

When I look at Visual Studio, there is one feature I would like to have in IntelliJ — live unit testing. In fact, I have to be more specific. If it were added to IntelliJ, it would probably work only with Java. I need such a feature in sbt. I need it to test Scala code.

Fortunately, there is something similar available. It does not have an excellent UX. You cannot record a 10 minutes long video tutorial about it, because it is too simple. Definitely, it is not perfect. However, in my opinion, it is good enough and gets the job done.

To get live unit testing in sbt, open a terminal window, navigate to your project directory, run sbt in interactive mode, and then run this command:

```
~test
```

It periodically looks for changes in your code and runs the relevant tests.

You can even run it in the “sbt-shell” window in IntelliJ and use the window “Floating mode” to make it always visible on the side of the screen.

![Live unit testing with sbt with a floating sbt-shell window](/images/2018-08-18-live-unit-testing-with-sbt/screen.png)