name: Jest

on:
  pull_request:
    branches:
      - main
    types: [opened, synchronize, reopened]

jobs:
  jest:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Branch
        uses: actions/checkout@v4
        with:
          ref: ${{ github.head_ref }}

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 18
          registry-url: "https://registry.npmjs.org"

      - name: Install Dependencies
        run: npx yarn

      - name: Run Jest
        run: npx yarn test
