Skip to content

Use it.each on Vitest test codes #1466#1467

Open
REI-MORI wants to merge 1 commit intomainfrom
1466-use-it.each-on-vitest-test-codes
Open

Use it.each on Vitest test codes #1466#1467
REI-MORI wants to merge 1 commit intomainfrom
1466-use-it.each-on-vitest-test-codes

Conversation

@REI-MORI
Copy link
Collaborator

@REI-MORI REI-MORI commented Nov 24, 2023

closes #1466

For the Submitter

Tasks

  • Make sure all checkboxes in the Issue content are checked
  • Make sure the PR title is in the format <Issue Title> <Issue Number>
  • Make sure "closes (issue number)" is written close to the top
  • Attach the enhancement label for update tasks
  • Make sure CI completes successfully
  • Check everything written in the PR
  • Fix the issues pointed out by AI
  • Add reviewers
  • On Slack, mention the PR reviewer, write your thoughts on the issue, and inform them that the PR has been created

For the Reviewer

Checks

  • Each task for the related issue are written and in checkboxes
  • The branch name is close to the issue name
  • CI completes successfully
  • Changes include only what is necessary for this PR
  • Necessary unit tests are implemented
  • Necessary E2E tests are implemented
  • Perform functionality checks
  • If there are any problems, request revisions from the PR submitter and mention them on Slack

After Reviewing

  • Leave an approval comment (e.g. LGTM)
  • On Slack, mention the PR submitter and a project admin, write which PR you have reviewed, and ask the project admin to review and merge the PR
  • If you are a project admin, merge the PR
  • Write an approval comment with praise on Slack

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 54445f6 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link

Update Summary

The revisions primarily involve changing the testing function used from 'test' to 'it' across multiple files.

src/lib/background/background.test.ts

  • Changed the function used to run tests from 'test' to 'it'.
  • No change in the logic or structure of tests.

src/lib/general/text_error.test.ts

  • The test function was updated from 'test' to 'it'.
  • Abstractly, no test case data or logic was altered.

src/lib/network/client_hostname.test.ts

  • Modified the testing function used from 'test' to 'it'.
  • There were no changes to the content or logic of the tests.

src/lib/text/valid_text.test.ts

  • Changed from using 'test' to 'it' for testing.
  • Other than this, the contents and logic remain the same.

src/lib/view/message.test.ts

  • 'test' function was replaced with 'it' for testing.
  • No changes were made to the logic or content of tests.

Suggestions for improvement

The updates mostly involve replacing the testing function; hence more of constraints in testing tools applied and not a logic change. Therefore, a generic suggestion can be provided for all files as mentioned below.

General Suggestions

  • It's good to follow consistent practices so using 'it' in place of 'test' benefits for readability and understanding.
  • Ensure to have adequate test coverage to account for edge cases.
  • Try to make tests independent and isolated. Any setup required for tests should be part of the test itself.
  • Make sure that test cases are descriptive about what they do, a third person reading the test case should be able to understand what the test does.
  • Look for opportunities to refactor or simplify code.

by OpenAI

@REI-MORI REI-MORI added the enhancement New feature or request label Nov 24, 2023
@REI-MORI REI-MORI requested a review from Acha0203 November 24, 2023 09:09
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use it.each on Vitest test codes

1 participant