Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Apr 16, 2024
1 parent a8613ea commit 991db45
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/cli/tests/project_graph_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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]
}

0 comments on commit 991db45

Please sign in to comment.