diff options
author | Satya Rohith <me@satyarohith.com> | 2021-09-13 09:49:23 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 09:49:23 +0530 |
commit | 84f874715763df71bb3bbf77f0714f8afdc17bb3 (patch) | |
tree | 1d4b2b5da1a79fab2f6ccec4fd15601057afbc77 /cli/tests/integration/lsp_tests.rs | |
parent | a442821d9790489242e8cdb9286ae3b237e4705c (diff) |
fix(lsp): support data urls in `deno.importMap` option (#11397)
Diffstat (limited to 'cli/tests/integration/lsp_tests.rs')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 762d8bb94..1b8d35108 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -317,6 +317,32 @@ fn lsp_import_map() { } #[test] +fn lsp_import_map_data_url() { + let mut client = init("initialize_params_import_map.json"); + let diagnostics = did_open( + &mut client, + json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "import example from \"example\";\n" + } + }), + ); + + let mut diagnostics = diagnostics.into_iter().flat_map(|x| x.diagnostics); + // This indicates that the import map from initialize_params_import_map.json + // is applied correctly. + assert!(diagnostics.any(|diagnostic| diagnostic.code + == Some(lsp::NumberOrString::String("no-cache".to_string())) + && diagnostic + .message + .contains("https://deno.land/x/example/mod.ts"))); + shutdown(&mut client); +} + +#[test] fn lsp_hover() { let mut client = init("initialize_params.json"); did_open( |