Merge branch 'main' into fix/issues-155-156-157-163-test-coverage #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Snapshot Tests | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| snapshot-tests: | ||
| name: Run snapshot tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| - name: Install dependencies | ||
| # This repo does not commit npm/yarn lockfiles, so npm ci and npm cache | ||
| # setup cannot run on GitHub Actions. | ||
| run: npm install --legacy-peer-deps | ||
| - name: Build project | ||
| run: npm run build | ||
| fix/issues-155-156-157-163-test-coverage | ||
| # Issue #156: Auth module snapshot tests (AuthComponents.snapshot.test.jsx) | ||
| # are picked up automatically by vitest alongside all other snapshot suites. | ||
| - name: Run snapshot tests (includes Auth module — Issue #156) | ||
| run: npm test -- --reporter=verbose | ||
| - name: Run snapshot tests | ||
| run: | | ||
| npm test -- --reporter=verbose $(find src/test -name "*.snapshot.test.*" -print) | ||
| main | ||
| - name: Check for snapshot changes | ||
| run: | | ||
| echo "📸 Checking for snapshot changes..." | ||
| if git diff --name-only | grep -q "__snapshots__"; then | ||
| echo "❌ Snapshot files have changed!" | ||
| echo "" | ||
| echo "Changed snapshot files:" | ||
| git diff --name-only | grep "__snapshots__" | ||
| echo "" | ||
| echo "Please review the snapshot changes and commit them if they are intentional." | ||
| echo "To update snapshots locally, run: npm test -- --update" | ||
| exit 1 | ||
| else | ||
| echo "✅ No snapshot changes detected" | ||
| fi | ||
| shell: bash | ||
| - name: Upload snapshot artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: snapshot-changes | ||
| path: | | ||
| src/**/__snapshots__/ | ||
| retention-days: 7 | ||