Skip to content

Commit

Permalink
chore(linter): change no-disabled-tests error message's position (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryven authored Sep 4, 2023
1 parent 1d83c56 commit be1be2e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions crates/oxc_linter/src/rules/jest/no_disabled_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use oxc_diagnostics::{
thiserror::Error,
};
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use oxc_span::{GetSpan, Span};

use crate::{
context::LintContext,
Expand Down Expand Up @@ -109,7 +109,7 @@ impl Rule for NoDisabledTests {
} else {
Message::DisabledTestWithX.details()
};
ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.span));
ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.callee.span()));
return;
}

Expand All @@ -121,7 +121,7 @@ impl Rule for NoDisabledTests {
} else {
Message::DisabledTestWithSkip.details()
};
ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.span));
ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.callee.span()));
}
} else if let Expression::Identifier(ident) = &call_expr.callee {
if ident.name.as_str() == "pending"
Expand Down
40 changes: 20 additions & 20 deletions crates/oxc_linter/src/snapshots/no_disabled_tests.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,140 +5,140 @@ expression: no_disabled_tests
eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1describe.skip('foo', function () {})
· ────────────────────────────────────
· ─────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1describe.skip.each([1, 2, 3])('%s', (a, b) => {});
· ─────────────────────────────────────────────────
· ─────────────────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1xdescribe.each([1, 2, 3])('%s', (a, b) => {});
· ─────────────────────────────────────────────
· ─────────────────────────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1describe[`skip`]('foo', function () {})
· ───────────────────────────────────────
· ────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1describe['skip']('foo', function () {})
· ───────────────────────────────────────
· ────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1it.skip('foo', function () {})
· ──────────────────────────────
· ───────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1it['skip']('foo', function () {})
· ─────────────────────────────────
· ──────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1test.skip('foo', function () {})
· ────────────────────────────────
· ─────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1it.skip.each``('foo', function () {})
· ─────────────────────────────────────
· ──────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1test.skip.each``('foo', function () {})
· ───────────────────────────────────────
· ────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1it.skip.each([])('foo', function () {})
· ───────────────────────────────────────
· ────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1test.skip.each([])('foo', function () {})
· ─────────────────────────────────────────
· ──────────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1test['skip']('foo', function () {})
· ───────────────────────────────────
· ────────────
╰────
help: "Remove the appending `.skip`"

eslint(jest/no-disabled-tests): "Disabled test suite"
╭─[no_disabled_tests.tsx:1:1]
1xdescribe('foo', function () {})
· ────────────────────────────────
· ─────────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xit('foo', function () {})
· ──────────────────────────
· ───
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xtest('foo', function () {})
· ────────────────────────────
· ─────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xit.each``('foo', function () {})
· ─────────────────────────────────
· ──────────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xtest.each``('foo', function () {})
· ───────────────────────────────────
· ────────────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xit.each([])('foo', function () {})
· ───────────────────────────────────
· ────────────
╰────
help: "Remove x prefix"

eslint(jest/no-disabled-tests): "Disabled test"
╭─[no_disabled_tests.tsx:1:1]
1xtest.each([])('foo', function () {})
· ─────────────────────────────────────
· ──────────────
╰────
help: "Remove x prefix"

Expand Down

0 comments on commit be1be2e

Please sign in to comment.