diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d261bdd..6f7cccc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -74,6 +74,7 @@ jobs: build: name: 🐳 Build + needs: [test, typecheck] # only build/deploy main branch on pushes if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} runs-on: ubuntu-latest @@ -127,7 +128,7 @@ jobs: deploy: name: 🚀 Deploy runs-on: ubuntu-latest - needs: [test, typecheck, build] + needs: [build] # only deploy main/dev branch on pushes if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index bb25409..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Test - -on: - push: - branches: - - main - - develop - pull_request: - branches: - - main - - develop - -jobs: - test: - name: Run Tests - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:15 - env: - POSTGRES_USER: test - POSTGRES_PASSWORD: test - POSTGRES_DB: brackt_test - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Run type check - run: npm run typecheck - continue-on-error: true - - - name: Run unit tests - run: npm run test:run - env: - DATABASE_URL: postgresql://test:test@localhost:5432/brackt_test - - - name: Upload test coverage - uses: codecov/codecov-action@v3 - if: always() - with: - files: ./coverage/coverage-final.json - flags: unittests - continue-on-error: true - - - name: Comment test results on PR - uses: actions/github-script@v7 - if: github.event_name == 'pull_request' && always() - with: - script: | - const fs = require('fs'); - let coverageComment = '## ✅ Tests Passed\n\n'; - - try { - const coverage = JSON.parse(fs.readFileSync('./coverage/coverage-summary.json', 'utf8')); - const total = coverage.total; - - coverageComment += '**Coverage:**\n'; - coverageComment += `- Lines: ${total.lines.pct}%\n`; - coverageComment += `- Statements: ${total.statements.pct}%\n`; - coverageComment += `- Functions: ${total.functions.pct}%\n`; - coverageComment += `- Branches: ${total.branches.pct}%\n`; - } catch (error) { - coverageComment += 'Coverage report not available.\n'; - } - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: coverageComment - }); - continue-on-error: true diff --git a/app/lib/__tests__/utils.test.ts b/app/lib/__tests__/utils.test.ts index 0a7371c..01b2086 100644 --- a/app/lib/__tests__/utils.test.ts +++ b/app/lib/__tests__/utils.test.ts @@ -10,7 +10,8 @@ describe('Utils', () => { }); it('should handle conditional classes', () => { - const result = cn('foo', false && 'bar', 'baz'); + const condition = false; + const result = cn('foo', condition && 'bar', 'baz'); expect(result).toContain('foo'); expect(result).toContain('baz'); expect(result).not.toContain('bar'); diff --git a/app/models/league.ts b/app/models/league.ts index 86c65f4..7f92e8b 100644 --- a/app/models/league.ts +++ b/app/models/league.ts @@ -78,6 +78,7 @@ export async function findLeaguesWithActiveSeasonsByUserId( name: schema.leagues.name, createdBy: schema.leagues.createdBy, currentSeasonId: schema.leagues.currentSeasonId, + isPublicDraftBoard: schema.leagues.isPublicDraftBoard, createdAt: schema.leagues.createdAt, updatedAt: schema.leagues.updatedAt, }) diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json new file mode 100644 index 0000000..e91e0c0 --- /dev/null +++ b/cypress/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2020", + "lib": ["ES2020", "DOM"], + "types": ["cypress", "@testing-library/cypress"], + "module": "ESNext", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ] +}