name: Test

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "22"
          
      - name: Clean install dependencies
        run: |
          rm -rf node_modules package-lock.json
          npm install
          
      - name: Run tests
        run: npm run test