summaryrefslogtreecommitdiff
path: root/tests/integration/lsp_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/lsp_tests.rs')
-rw-r--r--tests/integration/lsp_tests.rs50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs
index 9348d625c..862de41f6 100644
--- a/tests/integration/lsp_tests.rs
+++ b/tests/integration/lsp_tests.rs
@@ -11787,6 +11787,56 @@ fn lsp_jupyter_byonm_diagnostics() {
}
#[test]
+fn lsp_deno_future_env_byonm() {
+ let context = TestContextBuilder::for_npm()
+ .env("DENO_FUTURE", "1")
+ .use_temp_cwd()
+ .build();
+ let temp_dir = context.temp_dir();
+ temp_dir.path().join("package.json").write_json(&json!({
+ "dependencies": {
+ "@denotest/esm-basic": "*",
+ },
+ }));
+ context.run_npm("install");
+ let mut client = context.new_lsp_command().build();
+ client.initialize_default();
+ let diagnostics = client.did_open(json!({
+ "textDocument": {
+ "uri": temp_dir.uri().join("file.ts").unwrap(),
+ "languageId": "typescript",
+ "version": 1,
+ "text": r#"
+ import "npm:chalk";
+ import "@denotest/esm-basic";
+ "#,
+ },
+ }));
+ assert_eq!(
+ json!(diagnostics.all()),
+ json!([
+ {
+ "range": {
+ "start": {
+ "line": 1,
+ "character": 15,
+ },
+ "end": {
+ "line": 1,
+ "character": 26,
+ },
+ },
+ "severity": 1,
+ "code": "resolver-error",
+ "source": "deno",
+ "message": format!("Could not find a matching package for 'npm:chalk' in '{}'. You must specify this as a package.json dependency when the node_modules folder is not managed by Deno.", temp_dir.path().join("package.json")),
+ },
+ ])
+ );
+ client.shutdown();
+}
+
+#[test]
fn lsp_sloppy_imports_warn() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();