bevy-testing-patterns

Installation
SKILL.md

Bevy testing patterns

When to use

Load this when a Bevy crate needs unit or integration tests. cargo test runs #[test] functions. A headless App with MinimalPlugins is the harness for schedule logic.

ECS shape

  • Command: cargo test compiles and runs unit tests, integration tests, and documentation tests. cargo test name_filter runs names that contain the filter. Arguments after -- go to libtest (cargo test -- --help).
  • What runs: functions annotated with #[test]. The harness runs them in multiple threads. The working directory for each test is the package root, so relative paths resolve from that root no matter where you invoked Cargo.
  • Scope: default cargo test covers the lib, bins as unit tests, integration tests, and doc tests, and it builds examples. --lib limits to the library. harness = false on a target means you supply main.
  • Profile: the test profile is the default. --profile=debug keeps debug info. -- --no-capture shows test output.
  • Bevy types inside a test: build an App, insert the resource, add the system, call update, then read world(). Keep the window out of the harness with MinimalPlugins.

How to run

Installs
15
GitHub Stars
895
First Seen
Oct 11, 2026