diff options
Diffstat (limited to 'tests/integration/lint_tests.rs')
-rw-r--r-- | tests/integration/lint_tests.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/integration/lint_tests.rs b/tests/integration/lint_tests.rs index c0b1b4286..b47a98da4 100644 --- a/tests/integration/lint_tests.rs +++ b/tests/integration/lint_tests.rs @@ -4,6 +4,7 @@ use deno_core::serde_json::json; use test_util::assert_contains; use test_util::assert_not_contains; use test_util::itest; +use test_util::TestContext; use test_util::TestContextBuilder; itest!(ignore_unexplicit_files { @@ -235,3 +236,32 @@ fn opt_out_top_level_exclude_via_lint_unexclude() { assert_contains!(output, "excluded.ts"); assert_not_contains!(output, "actually_excluded.ts"); } + +#[test] +fn lint_stdin_jsx() { + TestContext::default() + .new_command() + .args("lint --ext=jsx -") + .stdin_text( + r#" +const data = <div>hello</div>; +"#, + ) + .run() + .assert_matches_text( + r#"error[no-unused-vars]: `data` is never used + --> [WILDLINE]$deno$stdin.jsx:2:7 + | +2 | const data = <div>hello</div>; + | ^^^^ + = hint: If this is intentional, prefix it with an underscore like `_data` + + docs: https://lint.deno.land/rules/no-unused-vars + + +Found 1 problem +Checked 1 file +"#, + ) + .assert_exit_code(1); +} |