// the find
godot-gdunit-labs/gdUnit4
Embedded unit testing framework for Godot 4 supporting GDScript and C#. Features test-driven development, embedded test inspector, extensive assertions, mocking, scene testing.
GdUnit4 is a unit testing framework embedded directly in the Godot 4 editor, supporting both GDScript and C#. It's the closest thing Godot has to a proper testing ecosystem — if you're shipping a non-trivial Godot game or tool and you're not using this, you're flying blind.
The scene runner is the standout feature: you can simulate mouse clicks, keyboard input, and touch events, then await signals or function return values — this is what makes testing game logic actually feasible rather than theoretical. Mocking and spying work at the GDScript level without requiring dependency injection gymnastics, which matters in a language where DI isn't idiomatic. CI integration is first-class: JUnit XML output, a GitHub Actions marketplace action, and a headless CLI runner mean you can gate PRs on test results without a display server. The fluent assertion API is well-typed for GDScript's dynamic nature, with type-specific assert classes (array, dict, signal, vector) instead of one generic assert that loses context.
The version compatibility matrix is a maintenance tax — you have to match your GdUnit4 version to your Godot version precisely, and the table already has 8+ rows with no sign of slowing down as Godot ships minor versions faster. The mock system generates doubled classes at runtime by parsing and re-emitting GDScript source, which means it breaks on any GDScript syntax the parser doesn't handle and produces cryptic failures when it does. C# support is split into a separate repo (gdUnit4Net) with its own versioning, so a Godot C# project ends up managing two plugin dependencies that can fall out of sync. Flaky test detection retries failed tests rather than isolating the non-determinism, which papers over timing issues in scene tests without surfacing the root cause.