diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 8b265f911..c211bbae4 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -7848,6 +7848,40 @@ fn lsp_json_no_diagnostics() { } #[test] +fn lsp_json_import_with_query_string() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write("data.json", r#"{"k": "v"}"#); + temp_dir.write( + "main.ts", + r#" + import data from "./data.json?1" with { type: "json" }; + console.log(data); + "#, + ); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + client.did_open(json!({ + "textDocument": { + "uri": temp_dir.uri().join("data.json").unwrap(), + "languageId": "json", + "version": 1, + "text": temp_dir.read_to_string("data.json"), + } + })); + let diagnostics = client.did_open(json!({ + "textDocument": { + "uri": temp_dir.uri().join("main.ts").unwrap(), + "languageId": "typescript", + "version": 1, + "text": temp_dir.read_to_string("main.ts"), + } + })); + assert_eq!(diagnostics.all(), vec![]); + client.shutdown(); +} + +#[test] fn lsp_format_markdown() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); @@ -9198,7 +9232,7 @@ fn lsp_data_urls_with_jsx_compiler_option() { "end": { "line": 1, "character": 1 } } }, { - "uri": "deno:/ed0224c51f7e2a845dfc0941ed6959675e5e3e3d2a39b127f0ff569c1ffda8d8/data_url.ts", + "uri": "deno:/5c42b5916c4a3fb55be33fdb0c3b1f438639420592d150fca1b6dc043c1df3d9/data_url.ts", "range": { "start": { "line": 0, "character": 7 }, "end": {"line": 0, "character": 14 }, |