Run your app in headless mode for testing
Bevy version: 0.14Last updated:
This can be useful for running app simulations during integration tests without spawning a window which can be problematic in a testing environment.
use bevy::prelude::*;
use bevy::render::{
settings::{RenderCreation, WgpuSettings},
RenderPlugin,
};
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(RenderPlugin {
synchronous_pipeline_compilation: true,
render_creation: RenderCreation::Automatic(WgpuSettings {
backends: None,
..default()
}),
}))
.run();
}
This will load everything your game would normally have, but then not run any of the rendering pipeline.