'Tests pass on github actions but process exit code 1

These tests are passing but the process exits code 1. Not sure what the issue is. Here is my github actions file and an image showing the tests passing with an exit code.

When I try running individual tests with -t, they seem to pass fine. But all tests exit code is 1

testpass

on:
  push:
    branches:
      - main
      - staging
      - dev
  pull_request:
    branches:
      - main
      - staging
      - dev

jobs:
  tests:
    name: Tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Read nvmrc
        id: nvmrc
        uses: browniebroke/read-nvmrc-action@v1

      - name: Set up node
        uses: actions/setup-node@v2
        with:
          node-version: '${{ steps.nvmrc.outputs.node_version }}'

      - name: Install dependencies
        run: yarn install --frozen-lockfile

      - name: Run tests
        run: yarn test


Solution 1:[1]

I managed to fix this issue. The problem was one of the tests was passing but throwing an error on one of the steps. Fixing the test fixed the above issue. The job was running as expected and had no issues.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kelvin Kitika