I have the following Project Structure
/
src/ # src-files for the app
org.mayapp.main.Main/
test/ # unit-tests
org.myapp.test.main.MainTestSuite/
When I want to run my Unit-Tests, e.g. org.myapp.test.main.MainTestSuite, IntelliJ always tries to compile all the packages in the whole project.
I want to prevent this, because I am currently developing on a part of my app and still want to run the Unit-Tests on other parts of the app.
Is there a way to prevent IntelliJ from compiling the whole project before running the Unit-Tests?
When you run a test in IntelliJ you’ll see it adds a run target for that test, see Run -> Edit Configurations under the JUnit section.
If you look at the run target for the test you’ll see there’s a Before Launch section that by default has Make selected. If you unselect Make IntelliJ won’t make/compile before the test is run.
Remember to save the run target as IntelliJ creates new ones as you run different tests.