writing-tests
Skill by JetBrains
Guides developers writing JUnit 5 tests in the IntelliJ IDEA codebase. It covers fixtures, lifecycle hooks, test disposables, and EDT and coroutine handling.
Install writing-tests
Built from the published package, never by AI.
git clone --depth 1 https://github.com/JetBrains/intellij-community /tmp/intellij-community && mkdir -p ~/.claude/skills && cp -r /tmp/intellij-community/.claude/skills/writing-tests ~/.claude/skills/writing-testsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/JetBrains/intellij-community /tmp/intellij-community && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/intellij-community/.claude/skills/writing-tests ~/.gemini/antigravity-cli/skills/writing-testsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant guidelines for writing JUnit 5 tests in the IntelliJ IDEA codebase. It explains where to place a test, based on the module that owns the production code. It covers the @TestApplication annotation, shared companion object fixtures, lifecycle hooks, and @TestDisposable. It also covers @RegistryKey and @SystemProperty for test configuration.
The skill explains coroutine and UI testing with timeoutRunBlocking and Dispatchers.UI, and when Dispatchers.EDT is needed. It advises against @RunInEdt and similar EDT helpers in new tests. It is aimed at developers contributing tests to the IntelliJ codebase, and it points to showcase tests in community/platform/testFramework/junit5/test/showcase/ as examples.
Written from the project's SKILL.md and checked against it.
What it can do
- Test module placementExplains how to choose the test module that owns the production code being tested.
- JUnit 5 setupDescribes using @TestApplication instead of extending LightJavaCodeInsightFixtureTestCase.
- Shared fixturesShows companion object fixtures for project and module fixtures shared between tests.
- Lifecycle hooksShows JUnit 5 setup and teardown with @BeforeAll, @BeforeEach, @AfterEach, and @AfterAll.
- Test disposablesShows injecting test-scoped disposables with @TestDisposable as a field or parameter.
- Registry and system propertiesShows setting registry values with @RegistryKey and system properties with @SystemProperty.
- Coroutine and UI testingExplains timeoutRunBlocking, Dispatchers.UI, and when to use Dispatchers.EDT.
- Showcase test referencesPoints to showcase test files that demonstrate fixture, disposable, and property patterns.
What you need
- A checkout of the IntelliJ IDEA community codebase
- JUnit 5 test setup used by the IntelliJ codebase
- The tests.cmd test runner for running tests
Try asking
- Write a JUnit 5 test for this class using @TestApplication and shared fixtures.
- Convert this JUnit 4 test that extends LightJavaCodeInsightFixtureTestCase to JUnit 5.
- Write a coroutine test that updates a Swing label using Dispatchers.UI.
Good to know
- Do not use @RunInEdt, @RunMethodInEdt, runInEdtAndWait, or runInEdtAndGet in new tests.
- Do not add a JUnit @Timeout to tests that use timeoutRunBlocking.
- JUnit5RunInEdtTest.java shows legacy behavior and should not be copied.
- Build-io tests belong in community/build/tasks/test, not the build-scripts test module.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/writing-tests/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to writing-tests
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
writing-tests: common questions
Where should I put a new IntelliJ JUnit 5 test?
Put it in the test module associated with the production module it exercises. Check the production module's .iml file and neighboring tests first.
Should I use EDT for tests in IntelliJ?
Prefer Dispatchers.UI for Swing operations and keep background work off the UI thread. Use Dispatchers.EDT only when the operation needs model or lock access and cannot be split.
How do I set a registry value in a test?
Use the @RegistryKey annotation instead of Registry.get().setValue(). The skill shows an example with key and value parameters.
How do I install writing-tests?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is writing-tests free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is writing-tests safe to use?
It scores 78 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to writing-tests?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
