summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/watcher_tests.rs2
-rw-r--r--cli/tests/testdata/doc/referenced_private_types_lint.out30
-rw-r--r--cli/tests/testdata/lint/expected_from_stdin.out11
-rw-r--r--cli/tests/testdata/lint/expected_from_stdin_json.out2
-rw-r--r--cli/tests/testdata/lint/expected_quiet.out26
-rw-r--r--cli/tests/testdata/lint/watch/badly_linted.js.out4
-rw-r--r--cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out2
-rw-r--r--cli/tests/testdata/lint/with_config.out28
-rw-r--r--cli/tests/testdata/lint/with_config_and_flags.out28
-rw-r--r--cli/tests/testdata/lint/with_config_without_tags.out28
-rw-r--r--cli/tests/testdata/publish/invalid_fast_check.out13
-rw-r--r--cli/tests/testdata/publish/javascript_missing_decl_file.out11
12 files changed, 122 insertions, 63 deletions
diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs
index 008df3385..6a2cab08a 100644
--- a/cli/tests/integration/watcher_tests.rs
+++ b/cli/tests/integration/watcher_tests.rs
@@ -62,7 +62,7 @@ where
if t.starts_with("Watcher") {
break;
}
- if t.starts_with('(') {
+ if t.starts_with("error[") {
str.push_str(&t);
str.push('\n');
}
diff --git a/cli/tests/testdata/doc/referenced_private_types_lint.out b/cli/tests/testdata/doc/referenced_private_types_lint.out
index 54f225059..328435cd7 100644
--- a/cli/tests/testdata/doc/referenced_private_types_lint.out
+++ b/cli/tests/testdata/doc/referenced_private_types_lint.out
@@ -1,8 +1,28 @@
-Missing JSDoc comment.
- at file:///[WILDCARD]/referenced_private_types.ts:5:1
+error[missing-jsdoc]: exported symbol is missing JSDoc documentation
+ --> [WILDCARD]:5:1
+ |
+5 | export class MyClass {
+ | ^
+
+
+error[private-type-ref]: public type 'MyClass.prototype.prop' references private type 'MyInterface'
+ --> [WILDCARD]:6:3
+ |
+6 | prop: MyInterface = {};
+ | ^
+ = hint: make the referenced type public or remove the reference
+ |
+1 | interface MyInterface {
+ | - this is the referenced type
+
+ info: to ensure documentation is complete all types that are exposed in the public API must be public
+
+
+error[missing-jsdoc]: exported symbol is missing JSDoc documentation
+ --> [WILDCARD]:6:3
+ |
+6 | prop: MyInterface = {};
+ | ^
-Type 'MyClass.prototype.prop' references type 'MyInterface' which is not exported from a root module.
-Missing JSDoc comment.
- at file:///[WILDCARD]/referenced_private_types.ts:6:3
error: Found 3 documentation lint errors.
diff --git a/cli/tests/testdata/lint/expected_from_stdin.out b/cli/tests/testdata/lint/expected_from_stdin.out
index 90f455fdc..59f32166f 100644
--- a/cli/tests/testdata/lint/expected_from_stdin.out
+++ b/cli/tests/testdata/lint/expected_from_stdin.out
@@ -1,3 +1,12 @@
-[WILDCARD]
+error[no-explicit-any]: `any` type is not allowed
+ --> [WILDCARD]$deno$stdin.ts:1:9
+ |
+1 | let _a: any;
+ | ^^^
+ = hint: Use a specific type other than `any`
+
+ docs: https://lint.deno.land/#no-explicit-any
+
+
Found 1 problem
Checked 1 file
diff --git a/cli/tests/testdata/lint/expected_from_stdin_json.out b/cli/tests/testdata/lint/expected_from_stdin_json.out
index 7ea40e957..26bf7ddc7 100644
--- a/cli/tests/testdata/lint/expected_from_stdin_json.out
+++ b/cli/tests/testdata/lint/expected_from_stdin_json.out
@@ -13,7 +13,7 @@
"bytePos": 11
}
},
- "filename": "_stdin.ts",
+ "filename": "[WILDCARD]$deno$stdin.ts",
"message": "`any` type is not allowed",
"code": "no-explicit-any",
"hint": [WILDCARD]
diff --git a/cli/tests/testdata/lint/expected_quiet.out b/cli/tests/testdata/lint/expected_quiet.out
index 7a2ef48e6..e46a94a2d 100644
--- a/cli/tests/testdata/lint/expected_quiet.out
+++ b/cli/tests/testdata/lint/expected_quiet.out
@@ -1,14 +1,20 @@
-(ban-untagged-ignore) Ignore directive requires lint rule name(s)
-// deno-lint-ignore
-^^^^^^^^^^^^^^^^^^^
- at [WILDCARD]file1.js:1:1
+error[ban-untagged-ignore]: Ignore directive requires lint rule name(s)
+ --> [WILDCARD]file1.js:1:1
+ |
+1 | // deno-lint-ignore
+ | ^^^^^^^^^^^^^^^^^^^
+ = hint: Add one or more lint rule names. E.g. // deno-lint-ignore adjacent-overload-signatures
- hint: [WILDCARD]
+ docs: https://lint.deno.land/#ban-untagged-ignore
-(no-empty) Empty block statement
-while (false) {}
- ^^
- at [WILDCARD]file1.js:2:15
- hint: [WILDCARD]
+error[no-empty]: Empty block statement
+ --> [WILDCARD]file1.js:2:15
+ |
+2 | while (false) {}
+ | ^^
+ = hint: Add code or comment to the empty block
+
+ docs: https://lint.deno.land/#no-empty
+
diff --git a/cli/tests/testdata/lint/watch/badly_linted.js.out b/cli/tests/testdata/lint/watch/badly_linted.js.out
index 5c715695a..07ae031c3 100644
--- a/cli/tests/testdata/lint/watch/badly_linted.js.out
+++ b/cli/tests/testdata/lint/watch/badly_linted.js.out
@@ -1,2 +1,2 @@
-(no-unused-vars) `a` is never used
-(prefer-const) `a` is never reassigned
+error[no-unused-vars]: `a` is never used
+error[prefer-const]: `a` is never reassigned
diff --git a/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out b/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
index fe74a7a2c..67e3c9dd8 100644
--- a/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
+++ b/cli/tests/testdata/lint/watch/badly_linted_fixed1.js.out
@@ -1 +1 @@
-(prefer-const) `_a` is never reassigned
+error[prefer-const]: `_a` is never reassigned
diff --git a/cli/tests/testdata/lint/with_config.out b/cli/tests/testdata/lint/with_config.out
index 2ea821c05..cffd6b9c7 100644
--- a/cli/tests/testdata/lint/with_config.out
+++ b/cli/tests/testdata/lint/with_config.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: foo
-^^^^^^^^^^^^
- at [WILDCARD]a.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]a.ts:1:1
+ |
+1 | // TODO: foo
+ | ^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `add` is never used
-function add(a: number, b: number): number {
- ^^^
- at [WILDCARD]a.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_add`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `add` is never used
+ --> [WILDCARD]a.ts:2:10
+ |
+2 | function add(a: number, b: number): number {
+ | ^^^
+ = hint: If this is intentional, prefix it with an underscore like `_add`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file
diff --git a/cli/tests/testdata/lint/with_config_and_flags.out b/cli/tests/testdata/lint/with_config_and_flags.out
index 41432df9d..f3ad3cafb 100644
--- a/cli/tests/testdata/lint/with_config_and_flags.out
+++ b/cli/tests/testdata/lint/with_config_and_flags.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: this file should be ignored
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- at [WILDCARD]b.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]b.ts:1:1
+ |
+1 | // TODO: this file should be ignored
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `subtract` is never used
-function subtract(a: number, b: number): number {
- ^^^^^^^^
- at [WILDCARD]b.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_subtract`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `subtract` is never used
+ --> [WILDCARD]b.ts:2:10
+ |
+2 | function subtract(a: number, b: number): number {
+ | ^^^^^^^^
+ = hint: If this is intentional, prefix it with an underscore like `_subtract`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file
diff --git a/cli/tests/testdata/lint/with_config_without_tags.out b/cli/tests/testdata/lint/with_config_without_tags.out
index 2ea821c05..cffd6b9c7 100644
--- a/cli/tests/testdata/lint/with_config_without_tags.out
+++ b/cli/tests/testdata/lint/with_config_without_tags.out
@@ -1,18 +1,22 @@
-(ban-untagged-todo) TODO should be tagged with (@username) or (#issue)
-// TODO: foo
-^^^^^^^^^^^^
- at [WILDCARD]a.ts:1:1
+error[ban-untagged-todo]: TODO should be tagged with (@username) or (#issue)
+ --> [WILDCARD]a.ts:1:1
+ |
+1 | // TODO: foo
+ | ^^^^^^^^^^^^
+ = hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- hint: Add a user tag or issue reference to the TODO comment, e.g. TODO(@djones), TODO(djones), TODO(#123)
- help: for further information visit https://lint.deno.land/#ban-untagged-todo
+ docs: https://lint.deno.land/#ban-untagged-todo
-(no-unused-vars) `add` is never used
-function add(a: number, b: number): number {
- ^^^
- at [WILDCARD]a.ts:2:10
- hint: If this is intentional, prefix it with an underscore like `_add`
- help: for further information visit https://lint.deno.land/#no-unused-vars
+error[no-unused-vars]: `add` is never used
+ --> [WILDCARD]a.ts:2:10
+ |
+2 | function add(a: number, b: number): number {
+ | ^^^
+ = hint: If this is intentional, prefix it with an underscore like `_add`
+
+ docs: https://lint.deno.land/#no-unused-vars
+
Found 2 problems
Checked 1 file
diff --git a/cli/tests/testdata/publish/invalid_fast_check.out b/cli/tests/testdata/publish/invalid_fast_check.out
index e34cfecdf..37e25e269 100644
--- a/cli/tests/testdata/publish/invalid_fast_check.out
+++ b/cli/tests/testdata/publish/invalid_fast_check.out
@@ -1,8 +1,13 @@
Checking fast check type graph for errors...
+error[zap-missing-explicit-return-type]: missing explicit return type in the public API
+ --> [WILDCARD]mod.ts:2:17
+ |
+2 | export function getRandom() {
+ | ^^^^^^^^^ this function is missing an explicit return type
+ = hint: add an explit return type to the function
-missing explicit return type in the public API
- at file:///[WILDCARD]/publish/invalid_fast_check/mod.ts@68
+ info: all functions in the public API must have an explicit return type
+ docs: https://jsr.io/go/zap-missing-explicit-return-type
-Fixing these fast check errors is required to make the code fast check compatible which enables type checking your package's TypeScript code with the same performance as if you had distributed declaration files. Do any of these errors seem too restrictive or incorrect? Please open an issue if so to help us improve: https://github.com/denoland/deno/issues
-error: Had 1 fast check error.
+error: Found 1 problem
diff --git a/cli/tests/testdata/publish/javascript_missing_decl_file.out b/cli/tests/testdata/publish/javascript_missing_decl_file.out
index 02478a5b5..bf7797c09 100644
--- a/cli/tests/testdata/publish/javascript_missing_decl_file.out
+++ b/cli/tests/testdata/publish/javascript_missing_decl_file.out
@@ -1,6 +1,13 @@
Checking fast check type graph for errors...
-Warning Package '@foo/bar' is a JavaScript package without a corresponding declaration file. This may lead to a non-optimal experience for users of your package. For performance reasons, it's recommended to ship a corresponding TypeScript declaration file or to convert to TypeScript.
-Ensuring type checks...
+warning[zap-unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoints
+ --> [WILDCARD]mod.js
+ = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript
+
+ info: JavaScript files with no corresponding declaration require type inference to be type checked
+ info: fast check avoids type inference, so JavaScript entrypoints should be avoided
+ docs: https://jsr.io/go/zap-unsupported-javascript-entrypoint
+
+
Publishing @foo/bar@1.0.0 ...
Successfully published @foo/bar@1.0.0
Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details