diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-02-19 10:28:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 15:28:41 +0000 |
commit | 66424032a2c78c6010c0a1a1b22a26d081166660 (patch) | |
tree | 610e95beba5685ef1ba322375bf31a3fd6c5a187 /tests/integration/lint_tests.rs | |
parent | 2b279ad630651e973d5a31586f58809f005bc925 (diff) |
feat(unstable/lint): no-slow-types for JSR packages (#22430)
1. Renames zap/fast-check to instead be a `no-slow-types` lint rule.
1. This lint rule is automatically run when doing `deno lint` for
packages (deno.json files with a name, version, and exports field)
1. This lint rules still occurs on publish. It can be skipped by running
with `--no-slow-types`
Diffstat (limited to 'tests/integration/lint_tests.rs')
-rw-r--r-- | tests/integration/lint_tests.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/integration/lint_tests.rs b/tests/integration/lint_tests.rs index f7c9ead36..ae0414262 100644 --- a/tests/integration/lint_tests.rs +++ b/tests/integration/lint_tests.rs @@ -210,3 +210,45 @@ fn lint_with_glob_config_and_flags() { assert_contains!(output, "Found 2 problems"); assert_contains!(output, "Checked 2 files"); } + +itest!(no_slow_types { + args: "lint", + output: "lint/no_slow_types/no_slow_types.out", + cwd: Some("lint/no_slow_types"), + exit_code: 1, +}); + +itest!(no_slow_types_entrypoint { + args: "lint a.ts", + output: "lint/no_slow_types/no_slow_types_entrypoint.out", + cwd: Some("lint/no_slow_types"), + exit_code: 1, +}); + +itest!(no_slow_types_non_entrypoint { + args: "lint d.ts", + output_str: Some("Checked 1 file\n"), + cwd: Some("lint/no_slow_types"), + exit_code: 0, +}); + +itest!(no_slow_types_excluded { + args: "lint --rules-exclude=no-slow-types", + output_str: Some("Checked 4 files\n"), + cwd: Some("lint/no_slow_types"), + exit_code: 0, +}); + +itest!(no_slow_types_non_package { + args: "lint --config=deno.non-package.json", + output_str: Some("Checked 4 files\n"), + cwd: Some("lint/no_slow_types"), + exit_code: 0, +}); + +itest!(no_slow_types_workspace { + args: "lint", + output: "lint/no_slow_types_workspace/output.out", + cwd: Some("lint/no_slow_types_workspace"), + exit_code: 1, +}); |