typescript: Fix handling of jest/vitest tests with regex characters in name (#35090)

Closes #35065

Release Notes:

- JavaScript/TypeScript tasks: Fixed handling of Vitest/Jest tests with
regex-specific characters in their name.
This commit is contained in:
Piotr Osiewicz 2025-07-25 14:23:52 +02:00 committed by GitHub
parent 631f9a1b31
commit 57b463fd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -512,7 +512,7 @@ fn eslint_server_binary_arguments(server_path: &Path) -> Vec<OsString> {
fn replace_test_name_parameters(test_name: &str) -> String {
let pattern = regex::Regex::new(r"(%|\$)[0-9a-zA-Z]+").unwrap();
pattern.replace_all(test_name, "(.+?)").to_string()
regex::escape(&pattern.replace_all(test_name, "(.+?)"))
}
pub struct TypeScriptLspAdapter {