writing-tests
Installation
SKILL.md
Writing Tests
Guidelines for writing tests in IntelliJ IDEA codebase.
For examples, see community/platform/testFramework/junit5/test/showcase/.
Prefer JUnit 5 over JUnit 4
Use JUnit 5 with @TestApplication annotation instead of extending LightJavaCodeInsightFixtureTestCase.
Why JUnit 5:
- Faster: No class hierarchy overhead, shared fixtures via companion objects
- Cleaner: Annotations (
@TestDisposable,@RegistryKey) instead of manual setup/teardown - Flexible: Mix EDT and non-EDT tests in one class, parameterized tests, nested tests
- Better isolation: Each test gets fresh disposables automatically
Shared Fixtures Pattern
Use companion object fixtures shared between all tests:
Related skills