From f6e2afcec82ff489efd8ea9bc8a3308e30492cf8 Mon Sep 17 00:00:00 2001 From: iceteaSA <171169159+iceteaSA@users.noreply.github.com> Date: Wed, 19 Aug 2026 22:33:51 +0200 Subject: [PATCH] test: build astro tsdk expectation with component joins astro_uses_the_nearest_project_typescript_sdk built its expected path as member.join("node_modules/typescript/lib"). Path::join keeps embedded forward slashes verbatim, so on Windows the expectation held ...\\apps/site\\node_modules/typescript/lib while find_project_typescript_sdk walks with .join("node_modules").join("typescript").join("lib") and produces ...\\node_modules\\typescript\\lib. Deterministic mismatch on Windows, invisible on unix where both spellings coincide. Build the expectation the way production builds the value. --- crates/aft/tests/integration/lsp_manager_test.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/aft/tests/integration/lsp_manager_test.rs b/crates/aft/tests/integration/lsp_manager_test.rs index 5e17ae62..f42a778f 100644 --- a/crates/aft/tests/integration/lsp_manager_test.rs +++ b/crates/aft/tests/integration/lsp_manager_test.rs @@ -447,10 +447,14 @@ fn test_custom_server_env_and_initialization_options_reach_spawned_server() { fn astro_uses_the_nearest_project_typescript_sdk() { let temp_dir = tempdir().unwrap(); let root = temp_dir.path().join("workspace"); - let member = root.join("apps/site"); - let page = member.join("src/page.astro"); - let root_tsdk = root.join("node_modules/typescript/lib"); - let member_tsdk = member.join("node_modules/typescript/lib"); + let member = root.join("apps").join("site"); + let page = member.join("src").join("page.astro"); + // Build the expected tsdk exactly as find_project_typescript_sdk does + // (component-wise joins). A single join("node_modules/typescript/lib") + // keeps its embedded forward slashes on Windows, so the comparison would + // hold a mixed-separator path the production walk never produces. + let root_tsdk = root.join("node_modules").join("typescript").join("lib"); + let member_tsdk = member.join("node_modules").join("typescript").join("lib"); fs::create_dir_all(page.parent().unwrap()).unwrap(); fs::create_dir_all(&root_tsdk).unwrap(); fs::create_dir_all(&member_tsdk).unwrap();