Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

languages: Escape test names for bun runner (#45749)

Patrick Kilgore64b05028ac9c
diff --git a/crates/languages/src/typescript.rs b/crates/languages/src/typescript.rs
index 4f9476d5afa..47716db38e1 100644
--- a/crates/languages/src/typescript.rs
+++ b/crates/languages/src/typescript.rs
@@ -56,6 +56,9 @@ const TYPESCRIPT_JASMINE_PACKAGE_PATH_VARIABLE: VariableName =
const TYPESCRIPT_BUN_PACKAGE_PATH_VARIABLE: VariableName =
VariableName::Custom(Cow::Borrowed("TYPESCRIPT_BUN_PACKAGE_PATH"));
+const TYPESCRIPT_BUN_TEST_NAME_VARIABLE: VariableName =
+ VariableName::Custom(Cow::Borrowed("TYPESCRIPT_BUN_TEST_NAME"));
+
const TYPESCRIPT_NODE_PACKAGE_PATH_VARIABLE: VariableName =
VariableName::Custom(Cow::Borrowed("TYPESCRIPT_NODE_PACKAGE_PATH"));
@@ -237,7 +240,7 @@ impl PackageJsonData {
args: vec![
"test".to_owned(),
"--test-name-pattern".to_owned(),
- format!("\"{}\"", VariableName::Symbol.template_value()),
+ format!("\"{}\"", TYPESCRIPT_BUN_TEST_NAME_VARIABLE.template_value()),
VariableName::File.template_value(),
],
tags: vec![
@@ -488,6 +491,10 @@ impl ContextProvider for TypeScriptContextProvider {
TYPESCRIPT_VITEST_TEST_NAME_VARIABLE,
replace_test_name_parameters(symbol),
);
+ vars.insert(
+ TYPESCRIPT_BUN_TEST_NAME_VARIABLE,
+ replace_test_name_parameters(symbol),
+ );
}
let file_path = location
.file_location