diff --git a/crates/turborepo-lib/src/turbo_json/mod.rs b/crates/turborepo-lib/src/turbo_json/mod.rs index ed7d89bd93d9e..16c0fe8a28f3c 100644 --- a/crates/turborepo-lib/src/turbo_json/mod.rs +++ b/crates/turborepo-lib/src/turbo_json/mod.rs @@ -781,7 +781,7 @@ mod tests { turbo_json::RawTaskDefinition, }; - #[test_case("{}", "empty")] + #[test_case("{}", "empty boundaries")] #[test_case(r#"{"tags": {} }"#, "empty tags")] #[test_case( r#"{"tags": { "my-tag": { "dependencies": { "allow": ["my-package"] } } } }"#, @@ -828,7 +828,7 @@ mod tests { "{}", RawTaskDefinition::default(), TaskDefinition::default() - ; "empty")] + ; "empty task definition")] #[test_case( r#"{ "persistent": false }"#, RawTaskDefinition { @@ -1045,7 +1045,7 @@ mod tests { assert_eq!(actual, expected); } - #[test_case(r#"{ "tags": [] }"#, "empty")] + #[test_case(r#"{ "tags": [] }"#, "empty tags in package")] #[test_case(r#"{ "tags": ["my-tag"] }"#, "one tag")] #[test_case(r#"{ "tags": ["my-tag", "my-other-tag"] }"#, "two tags")] fn test_tags(json: &str, name: &str) { diff --git a/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty.snap b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty.snap index 1497dfca7fe29..e4b2050155490 100644 --- a/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty.snap +++ b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty.snap @@ -1,5 +1,7 @@ --- source: crates/turborepo-lib/src/turbo_json/mod.rs -expression: json.tags +expression: raw_task_definition --- -[] +{ + "tags": null +} diff --git a/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_boundaries.snap b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_boundaries.snap new file mode 100644 index 0000000000000..e4b2050155490 --- /dev/null +++ b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_boundaries.snap @@ -0,0 +1,7 @@ +--- +source: crates/turborepo-lib/src/turbo_json/mod.rs +expression: raw_task_definition +--- +{ + "tags": null +} diff --git a/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_tags_in_package.snap b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_tags_in_package.snap new file mode 100644 index 0000000000000..1497dfca7fe29 --- /dev/null +++ b/crates/turborepo-lib/src/turbo_json/snapshots/turborepo_lib__turbo_json__tests__empty_tags_in_package.snap @@ -0,0 +1,5 @@ +--- +source: crates/turborepo-lib/src/turbo_json/mod.rs +expression: json.tags +--- +[] diff --git a/turborepo-tests/integration/tests/bad-turbo-json.t b/turborepo-tests/integration/tests/bad-turbo-json.t index 038e7b17c2843..221455abacedb 100644 --- a/turborepo-tests/integration/tests/bad-turbo-json.t +++ b/turborepo-tests/integration/tests/bad-turbo-json.t @@ -13,7 +13,7 @@ Run build with package task in non-root turbo.json unnecessary-package-task-syntax) x "my-app#build". Use "build" instead. - ,-(apps/my-app/turbo.json:8:21) + ,-\(apps(\/|\\)my-app(\/|\\)turbo.json:8:21\) (re) 7 | // this comment verifies that turbo can read .json files with comments 8 | ,-> "my-app#build": {