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: add jest coverage #42

Merged
merged 3 commits into from
May 14, 2024
Merged

feat: add jest coverage #42

merged 3 commits into from
May 14, 2024

Conversation

apurv-wednesday
Copy link
Contributor

@apurv-wednesday apurv-wednesday commented May 10, 2024

Summary by CodeRabbit

  • Chores
    • Updated test configuration to enforce coverage thresholds and enhanced coverage reporting.

Copy link

coderabbitai bot commented May 10, 2024

Walkthrough

The jest.config.ts file has been updated to enhance code coverage reporting and enforce stricter coverage thresholds. Specific thresholds for statements, branches, lines, and functions have been defined, ensuring a higher standard of test coverage. Additionally, the coverage reporters have been expanded to include "json-summary", "text", and "lcov", providing more comprehensive and varied reporting formats.

Changes

File Change Summary
jest.config.ts Added coverageThreshold with specific thresholds for statements, branches, lines, and functions. Updated coverageReporters to include ["json-summary", "text", "lcov"].

🐇

In the land of code so bright,
Jest now checks with all its might.
Coverage high, no test shall fail,
With reports in detail.
JSON, text, and lcov's tale,
Ensuring quality prevails.

🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

This comment has been minimized.

Copy link

Jest Coverage Report

Total coverage

Status Category Percentage Covered / Total
🟡 Statements 60.16% 299/497
🔴 Branches 49.59% 60/121
🔴 Functions 54.17% 52/96
🟡 Lines 64.54% 253/392

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from 06caee4

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 70c9fe8 and 06caee4.
Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • jest.config.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • jest.config.ts
Additional comments not posted (1)
.github/workflows/ci.yml (1)

58-63: Ensure the artiomtr/[email protected] is stable for production use.

@apurv-wednesday apurv-wednesday changed the title feat: add jest coverage yaml feat: add jest coverage May 10, 2024

This comment has been minimized.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 06caee4 and 351c143.
Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
Additional comments not posted (1)
.github/workflows/ci.yml (1)

62-62: Verify the necessity of skip-step: all.

It appears that skip-step: all might prevent the execution of important sub-steps in the coverage report generation. Please confirm if this setting is intended or if it should be adjusted to allow specific steps to execute.

Copy link

Jest Coverage Report

Caution

Multiple errors occurred

 1 | Coverage output file not found. (file "report.json" not found)
 2 | Getting code coverage data failed.
St.
Category Percentage Covered / Total
🟡 Statements 60.16% 299/497
🔴 Branches 49.59% 60/121
🔴 Functions 54.17% 52/96
🟡 Lines 64.54% 253/392

Test suite run success

57 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 351c143

Copy link

github-actions bot commented May 10, 2024

Jest Coverage Report

St.
Category Percentage Covered / Total
🟡 Statements 60.16% 299/497
🔴 Branches 49.59% 60/121
🔴 Functions 54.17% 52/96
🟡 Lines 64.54% 253/392

Test suite run success

57 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 891f1d8

This comment has been minimized.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 351c143 and 61154cc.
Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
Additional comments not posted (1)
.github/workflows/ci.yml (1)

45-45: Verify the skip-step: install configuration to ensure it doesn't inadvertently skip necessary steps for coverage report generation.

Verification successful

The skip-step: install configuration in the GitHub Actions workflow is appropriate. The dependencies are installed in a previous step, ensuring that all necessary packages are available by the time the coverage report generation begins. This setup optimizes the workflow by avoiding redundant installation steps.

  • The dependencies are installed in the "Install dependencies" step using yarn.
  • The "Test and generate coverage report" step correctly skips the redundant installation, as dependencies are already available.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the `skip-step` configuration in the Jest coverage report action.

# Test: Search for the `skip-step` configuration in the workflow file. Expect: Only the 'install' step should be skipped.
rg --type yaml $'skip-step: install' .github/workflows/ci.yml

Length of output: 91



Script:

#!/bin/bash
# Description: Review the entire GitHub Actions workflow to understand the context of the `skip-step: install` configuration.

# Test: Display the entire content of the GitHub Actions workflow file to analyze the sequence of steps and their dependencies.
cat .github/workflows/ci.yml

Length of output: 1696

jest.config.ts Outdated Show resolved Hide resolved
@alichherawalla
Copy link
Contributor

one small change, merge post that

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 61154cc and 891f1d8.
Files selected for processing (1)
  • jest.config.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • jest.config.ts

Copy link

sonarqube-ws bot commented May 14, 2024

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (61.00% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: wednesday-solutions_next-bulletproof-ts_AY6yu6eKB2n8RRmGoUz4

View in SonarQube

@alichherawalla alichherawalla merged commit 06409e9 into main May 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants