diff --git a/crates/cli/tests/project_graph_test.rs b/crates/cli/tests/project_graph_test.rs index a77cc5821da..77817492a33 100644 --- a/crates/cli/tests/project_graph_test.rs +++ b/crates/cli/tests/project_graph_test.rs @@ -50,6 +50,27 @@ fn single_project_with_dependencies() { assert_snapshot!(assert.output()); } +#[test] +fn single_project_with_dependents() { + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); + + let sandbox = create_sandbox_with_config( + "projects", + Some(workspace_config), + Some(toolchain_config), + Some(tasks_config), + ); + + let assert = sandbox.run_moon(|cmd| { + cmd.arg("project-graph") + .arg("bar") + .arg("--dot") + .arg("--dependents"); + }); + + assert_snapshot!(assert.output()); +} + #[test] fn single_project_no_dependencies() { let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); diff --git a/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependents.snap b/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependents.snap new file mode 100644 index 00000000000..b53284b29c1 --- /dev/null +++ b/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependents.snap @@ -0,0 +1,9 @@ +--- +source: crates/cli/tests/project_graph_test.rs +expression: assert.output() +--- +digraph { + 0 [ label="bar" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="foo" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 -> 0 [ label="production" arrowhead=box, arrowtail=box] +}