Skip to content

Commit

Permalink
chore: make LSP test less prone to changes (denoland#20003)
Browse files Browse the repository at this point in the history
This test was getting changed often, I modified it a bit
so it's less sensitive to changes in declaration files.
  • Loading branch information
bartlomieju committed Aug 1, 2023
1 parent 9840369 commit a05e890
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cli/tests/integration/lsp_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -5130,15 +5133,15 @@ fn lsp_completions_auto_import() {
"source": "./b.ts",
"data": {
"exportName": "foo",
"exportMapKey": "foo|6811|file:https:///a/b",
"exportMapKey": "",
"moduleSpecifier": "./b.ts",
"fileName": "file:https:///a/b.ts"
},
"useCodeSnippet": false
}
}
});
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!(
Expand Down

0 comments on commit a05e890

Please sign in to comment.