Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(biome_js_analyze): noExclusiveTests #1965

Closed
wants to merge 1 commit into from

Conversation

chansuke
Copy link
Member

@chansuke chansuke commented Mar 5, 2024

Summary

Fixes #597

Test Plan

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Mar 5, 2024
Copy link

netlify bot commented Mar 5, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 835e2bf
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65e6a5b630a9b40008cba078
😎 Deploy Preview https://deploy-preview-1965--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codspeed-hq bot commented Mar 5, 2024

CodSpeed Performance Report

Merging #1965 will improve performances by 19.43%

⚠️ No base runs were found

Falling back to comparing chansuke:feat/no-exclusive-tets (835e2bf) with main (2e2951e)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main chansuke:feat/no-exclusive-tets Change
eucjp.json[cached] 5 ms 4.2 ms +19.43%

@github-actions github-actions bot added A-CLI Area: CLI A-Core Area: core labels Mar 5, 2024
@chansuke chansuke marked this pull request as ready for review March 5, 2024 05:29
Copy link
Contributor

@togami2864 togami2864 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments 👀

const CALEE_NAMES: [&str; 3] = ["describe", "it", "test"];

impl Rule for NoExclusiveTests {
type Query = Ast<JsCallExpression>;
Copy link
Contributor

@togami2864 togami2864 Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version: "next",
name: "noExclusiveTests",
recommended: true,
source: RuleSource::EslintJest("no-exclusive-tests"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-exclusive-test doesn't exist in eslint-plugin-jest. It's the rule of the eslint-plugin-mocha.

Comment on lines +1 to +11
describe.only("bar", function () {});
it.only("bar", function () {});
test.only("bar", function () {});

describe.only("bar", () => {});
it.only("bar", () => {});
test.only("bar", () => {});

describe["only"]("bar", function () {});
it["only"]("bar", function () {});
test["only"]("bar", function () {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also handle fdescribe, fit and ftest.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@togami2864
Thank you for your review!! I will address feedbacks!

@Conaclos
Copy link
Member

Conaclos commented Mar 6, 2024

@chansuke
I think the rule was implemented in #1864. It had some coordination issues... You could improve the implementation of the existing rule if possible.

@chansuke
Copy link
Member Author

chansuke commented Mar 6, 2024

@Conaclos

Yes...I will update the existing implementation(noFocusedTests).

I think we could restrict the rule to test.only, describe.only and it.only.

noFocusedTests covers fit and fdscribe method and can I update noFocusedTests to only covers only method like below?

  • test.only("foo", () => {});
  • test["only"]("bar", function () {});

@Conaclos
Copy link
Member

Conaclos commented Mar 6, 2024

noFocusedTests covers fit and fdscribe method and can I update noFocusedTests to only covers only method like below?

Yes :)

@chansuke
Copy link
Member Author

chansuke commented Mar 7, 2024

@Conaclos
Thank you!

@chansuke
Copy link
Member Author

I've created new PR #1999
close this branch 🙇

@chansuke chansuke closed this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI A-Core Area: core A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
3 participants