diff options
Diffstat (limited to 'cli/tests/lsp')
| -rw-r--r-- | cli/tests/lsp/code_lens_response_test.json | 162 | ||||
| -rw-r--r-- | cli/tests/lsp/did_open_params_test_code_lens.json | 8 | ||||
| -rw-r--r-- | cli/tests/lsp/initialize_params.json | 3 | ||||
| -rw-r--r-- | cli/tests/lsp/initialize_params_code_lens_test.json | 56 | ||||
| -rw-r--r-- | cli/tests/lsp/initialize_params_code_lens_test_disabled.json | 61 |
5 files changed, 289 insertions, 1 deletions
diff --git a/cli/tests/lsp/code_lens_response_test.json b/cli/tests/lsp/code_lens_response_test.json new file mode 100644 index 000000000..b2cb4588a --- /dev/null +++ b/cli/tests/lsp/code_lens_response_test.json @@ -0,0 +1,162 @@ +[ + { + "range": { + "start": { + "line": 4, + "character": 5 + }, + "end": { + "line": 4, + "character": 9 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test a" + ] + } + }, + { + "range": { + "start": { + "line": 5, + "character": 5 + }, + "end": { + "line": 5, + "character": 9 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test b" + ] + } + }, + { + "range": { + "start": { + "line": 9, + "character": 0 + }, + "end": { + "line": 9, + "character": 4 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test c" + ] + } + }, + { + "range": { + "start": { + "line": 13, + "character": 0 + }, + "end": { + "line": 13, + "character": 4 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test d" + ] + } + }, + { + "range": { + "start": { + "line": 14, + "character": 0 + }, + "end": { + "line": 14, + "character": 5 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test e" + ] + } + }, + { + "range": { + "start": { + "line": 18, + "character": 0 + }, + "end": { + "line": 18, + "character": 5 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test f" + ] + } + }, + { + "range": { + "start": { + "line": 19, + "character": 0 + }, + "end": { + "line": 19, + "character": 5 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test g" + ] + } + }, + { + "range": { + "start": { + "line": 23, + "character": 0 + }, + "end": { + "line": 23, + "character": 5 + } + }, + "command": { + "title": "▶︎ Run Test", + "command": "deno.test", + "arguments": [ + "file:///a/file.ts", + "test h" + ] + } + } +] diff --git a/cli/tests/lsp/did_open_params_test_code_lens.json b/cli/tests/lsp/did_open_params_test_code_lens.json new file mode 100644 index 000000000..dcb9e11f3 --- /dev/null +++ b/cli/tests/lsp/did_open_params_test_code_lens.json @@ -0,0 +1,8 @@ +{ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "const { test } = Deno;\nconst { test: test2 } = Deno;\nconst test3 = Deno.test;\n\nDeno.test(\"test a\", () => {});\nDeno.test({\n name: \"test b\",\n fn() {},\n});\ntest({\n name: \"test c\",\n fn() {},\n});\ntest(\"test d\", () => {});\ntest2({\n name: \"test e\",\n fn() {},\n});\ntest2(\"test f\", () => {});\ntest3({\n name: \"test g\",\n fn() {},\n});\ntest3(\"test h\", () => {});\n" + } +} diff --git a/cli/tests/lsp/initialize_params.json b/cli/tests/lsp/initialize_params.json index 98ec53aa6..01b334cd5 100644 --- a/cli/tests/lsp/initialize_params.json +++ b/cli/tests/lsp/initialize_params.json @@ -9,7 +9,8 @@ "enable": true, "codeLens": { "implementations": true, - "references": true + "references": true, + "test": true }, "importMap": null, "lint": true, diff --git a/cli/tests/lsp/initialize_params_code_lens_test.json b/cli/tests/lsp/initialize_params_code_lens_test.json new file mode 100644 index 000000000..792928462 --- /dev/null +++ b/cli/tests/lsp/initialize_params_code_lens_test.json @@ -0,0 +1,56 @@ +{ + "processId": 0, + "clientInfo": { + "name": "test-harness", + "version": "1.0.0" + }, + "rootUri": null, + "initializationOptions": { + "enable": true, + "importMap": null, + "lint": true, + "suggest": { + "autoImports": true, + "completeFunctionCalls": false, + "names": true, + "paths": true, + "imports": { + "hosts": {} + } + }, + "unstable": false + }, + "capabilities": { + "textDocument": { + "codeAction": { + "codeActionLiteralSupport": { + "codeActionKind": { + "valueSet": [ + "quickfix" + ] + } + }, + "isPreferredSupport": true, + "dataSupport": true, + "resolveSupport": { + "properties": [ + "edit" + ] + } + }, + "foldingRange": { + "lineFoldingOnly": true + }, + "synchronization": { + "dynamicRegistration": true, + "willSave": true, + "willSaveWaitUntil": true, + "didSave": true + } + }, + "workspace": { + "configuration": true, + "workspaceFolders": true + } + } +} diff --git a/cli/tests/lsp/initialize_params_code_lens_test_disabled.json b/cli/tests/lsp/initialize_params_code_lens_test_disabled.json new file mode 100644 index 000000000..febec5695 --- /dev/null +++ b/cli/tests/lsp/initialize_params_code_lens_test_disabled.json @@ -0,0 +1,61 @@ +{ + "processId": 0, + "clientInfo": { + "name": "test-harness", + "version": "1.0.0" + }, + "rootUri": null, + "initializationOptions": { + "enable": true, + "codeLens": { + "implementations": true, + "references": true, + "test": false + }, + "importMap": null, + "lint": true, + "suggest": { + "autoImports": true, + "completeFunctionCalls": false, + "names": true, + "paths": true, + "imports": { + "hosts": {} + } + }, + "unstable": false + }, + "capabilities": { + "textDocument": { + "codeAction": { + "codeActionLiteralSupport": { + "codeActionKind": { + "valueSet": [ + "quickfix" + ] + } + }, + "isPreferredSupport": true, + "dataSupport": true, + "resolveSupport": { + "properties": [ + "edit" + ] + } + }, + "foldingRange": { + "lineFoldingOnly": true + }, + "synchronization": { + "dynamicRegistration": true, + "willSave": true, + "willSaveWaitUntil": true, + "didSave": true + } + }, + "workspace": { + "configuration": true, + "workspaceFolders": true + } + } +} |
