diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-08-01 03:31:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-31 21:31:30 -0400 |
commit | a05e890d566979ead5f94ef9c897c0fa5b0bfdc7 (patch) | |
tree | 61809c8442b4e443a7b5349d1387f7073e6972db | |
parent | 98403691d100fec0804c86d8b89d0d3f8da68354 (diff) |
chore: make LSP test less prone to changes (#20003)
This test was getting changed often, I modified it a bit
so it's less sensitive to changes in declaration files.
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 22951825b..a1a2b0258 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -5108,9 +5108,12 @@ fn lsp_completions_auto_import() { ); assert!(!list.is_incomplete); let item = list.items.iter().find(|item| item.label == "foo"); - if item.is_none() { + let Some(item) = item else { panic!("completions items missing 'foo' symbol"); - } + }; + let mut item_value = serde_json::to_value(item).unwrap(); + item_value["data"]["tsc"]["data"]["exportMapKey"] = + serde_json::Value::String("".to_string()); let req = json!({ "label": "foo", @@ -5130,7 +5133,7 @@ fn lsp_completions_auto_import() { "source": "./b.ts", "data": { "exportName": "foo", - "exportMapKey": "foo|6811|file:///a/b", + "exportMapKey": "", "moduleSpecifier": "./b.ts", "fileName": "file:///a/b.ts" }, @@ -5138,7 +5141,7 @@ fn lsp_completions_auto_import() { } } }); - assert_eq!(serde_json::to_value(item.unwrap()).unwrap(), req); + assert_eq!(item_value, req); let res = client.write_request("completionItem/resolve", req); assert_eq!( |