Skip to content

This Action allows you to create annotations and coverage reports based on Jest's output.

License

Notifications You must be signed in to change notification settings

Manogel/jest-pr-analysis

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Jest Pull Request Analysis

This Action allows you to create annotations and coverage reports based on Jest's output.

Example: PR Comment

Example: Spoiler comment

Features:

  • ✅ Reporting code coverage on each pull request
  • ✅ Show spoiler comment in non tested file
  • ✅ Show spoiler comment in non coverage file
  • ✅ Reject pull request, if coverage is not met to threshold

Usage

  1. Install and configure Jest in your project.
    1.1. Configure jest in your package.json. [Required]

    NOTE: For now this action don't support jest.config.js|ts|mjs|cjs|json file config.

"name": "your project name",
"jest": {
  "testRegex": "",
  "collectCoverageFrom": [],
  "coverageThreshold": {}
}
  1. Create action inside .github/workflows:

    NOTE: For now this action only support on: pull_request trigger.

name: PR analysis

on:
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  annotate-pr:
    runs-on: ubuntu-latest
    name: Run tests on pull request
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - uses: actions/setup-node@v3
        with:
          node-version: '18'
          cache: 'yarn'

      - run: yarn install

      - name: Jest PR analysis
        uses: Manogel/[email protected]

License

MIT © Manogel

About

This Action allows you to create annotations and coverage reports based on Jest's output.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages