From 7c94d7f61b73a8eef524ba666269f18728ff4581 Mon Sep 17 00:00:00 2001 From: "gitauto-for-dev[bot]" <160085510+gitauto-for-dev[bot]@users.noreply.github.com> Date: Sat, 21 Feb 2026 01:51:32 +0000 Subject: [PATCH 1/2] Initial empty commit to create PR [skip ci] From b5f0211877d314009796f3f960536d08e4f4c3d9 Mon Sep 17 00:00:00 2001 From: "gitauto-for-dev[bot]" <160085510+gitauto-for-dev[bot]@users.noreply.github.com> Date: Sat, 21 Feb 2026 01:52:01 +0000 Subject: [PATCH 2/2] Replace content of .github/workflows/jest.yml --- .github/workflows/jest.yml | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/jest.yml diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml new file mode 100644 index 0000000..6fceea6 --- /dev/null +++ b/.github/workflows/jest.yml @@ -0,0 +1,62 @@ +name: Jest + +on: + # Run tests on PRs to verify code doesn't break before merge + pull_request: + types: [opened, synchronize] + # Your production branch. If not the default, update here and set Target Branch at https://gitauto.ai/settings/rules to match + branches: [main] + paths: + - '**/*.js' + - package.json + - package-lock.json + - jest.config.js + # Run tests after merge and collect coverage as canonical source of truth + push: + # Your production branch. If not the default, update here and set Target Branch at https://gitauto.ai/settings/rules to match + branches: [main] + paths: + - '**/*.js' + - package.json + - package-lock.json + - jest.config.js + # Allow manual trigger for debugging + workflow_dispatch: + +# Cancel older runs when new commits are pushed to the same PR/branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + # Match your project's Node.js version + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + # Skip coverage on PRs to keep runs fast + NODE_OPTIONS='--experimental-vm-modules' npx jest --no-coverage + else + # Collect lcov coverage on push/workflow_dispatch + NODE_OPTIONS='--experimental-vm-modules' npx jest --coverage --coverageReporters=lcov --coverageDirectory=coverage + fi + + - name: Upload coverage report + if: github.event_name != 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/lcov.info