summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/testdata/lsp/code_action_response_imports.json120
-rw-r--r--cli/tests/testdata/lsp/deno.import_map.jsonc2
-rw-r--r--cli/tests/unit/console_test.ts2
-rw-r--r--cli/tests/unit/http_test.ts4
4 files changed, 5 insertions, 123 deletions
diff --git a/cli/tests/testdata/lsp/code_action_response_imports.json b/cli/tests/testdata/lsp/code_action_response_imports.json
index cb1de6d77..4bbbb9c75 100644
--- a/cli/tests/testdata/lsp/code_action_response_imports.json
+++ b/cli/tests/testdata/lsp/code_action_response_imports.json
@@ -73,53 +73,6 @@
}
},
{
- "title": "Add missing function declaration 'abc'",
- "kind": "quickfix",
- "diagnostics": [
- {
- "range": {
- "start": {
- "line": 1,
- "character": 12
- },
- "end": {
- "line": 1,
- "character": 15
- }
- },
- "severity": 1,
- "code": 2304,
- "source": "deno-ts",
- "message": "Cannot find name 'abc'."
- }
- ],
- "edit": {
- "documentChanges": [
- {
- "textDocument": {
- "uri": "file:///a/file01.ts",
- "version": 1
- },
- "edits": [
- {
- "range": {
- "start": {
- "line": 3,
- "character": 0
- },
- "end": {
- "line": 3,
- "character": 0
- }
- },
- "newText": "\nfunction abc(abc: any) {\nthrow new Error(\"Function not implemented.\");\n}\n"
- }
- ]
- }
- ]
- }
- },
- {
"title": "Add import from \"./file00.ts\"",
"kind": "quickfix",
"diagnostics": [
@@ -165,78 +118,5 @@
}
]
}
- },
- {
- "title": "Add missing function declaration 'def'",
- "kind": "quickfix",
- "diagnostics": [
- {
- "range": {
- "start": {
- "line": 2,
- "character": 12
- },
- "end": {
- "line": 2,
- "character": 15
- }
- },
- "severity": 1,
- "code": 2304,
- "source": "deno-ts",
- "message": "Cannot find name 'def'."
- }
- ],
- "edit": {
- "documentChanges": [
- {
- "textDocument": {
- "uri": "file:///a/file01.ts",
- "version": 1
- },
- "edits": [
- {
- "range": {
- "start": {
- "line": 3,
- "character": 0
- },
- "end": {
- "line": 3,
- "character": 0
- }
- },
- "newText": "\nfunction def(def: any) {\nthrow new Error(\"Function not implemented.\");\n}\n"
- }
- ]
- }
- ]
- }
- },
- {
- "title": "Add all missing function declarations",
- "kind": "quickfix",
- "diagnostics": [
- {
- "range": {
- "start": {
- "line": 1,
- "character": 12
- },
- "end": {
- "line": 1,
- "character": 15
- }
- },
- "severity": 1,
- "code": 2304,
- "source": "deno-ts",
- "message": "Cannot find name 'abc'."
- }
- ],
- "data": {
- "specifier": "file:///a/file01.ts",
- "fixId": "fixMissingFunctionDeclaration"
- }
}
]
diff --git a/cli/tests/testdata/lsp/deno.import_map.jsonc b/cli/tests/testdata/lsp/deno.import_map.jsonc
index cee56432e..1682ff6b5 100644
--- a/cli/tests/testdata/lsp/deno.import_map.jsonc
+++ b/cli/tests/testdata/lsp/deno.import_map.jsonc
@@ -1,3 +1,3 @@
{
"importMap": "import-map.json"
-} \ No newline at end of file
+}
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index 1faef6bd7..ad7c0caa7 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -1918,7 +1918,7 @@ Deno.test(function inspectErrorCircular() {
cause: new Error("This is a cause error"),
});
error1.cause = error1;
- assert(error2.cause);
+ assert(error2.cause instanceof Error);
error2.cause.cause = error2;
assertStringIncludes(
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index eeb75c934..3de93076e 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -1214,7 +1214,9 @@ Deno.test(
async function client() {
const socket = new WebSocket(`ws://${hostname}:${port}/`);
socket.onopen = () => socket.send("bla bla");
- const { data } = await new Promise((res) => socket.onmessage = res);
+ const { data } = await new Promise<MessageEvent<string>>((res) =>
+ socket.onmessage = res
+ );
assertStrictEquals(data, "bla bla");
socket.close();
}