Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
33fb6ad
Initial plan
Copilot Feb 13, 2026
7af9811
Add test infrastructure and utility function tests
Copilot Feb 13, 2026
a8ea479
Add CI/CD workflow and comprehensive testing documentation
Copilot Feb 13, 2026
839e420
Add channelError tests and example service layer tests
Copilot Feb 13, 2026
eee9e13
Add comprehensive test coverage implementation summary
Copilot Feb 13, 2026
e99b9ae
Add clarifying comment about Jest timer API usage
Copilot Feb 13, 2026
fd4fe26
Fix security: Add explicit permissions to GitHub Actions workflow
Copilot Feb 13, 2026
0ecf3d5
Update test.yml
jnahian Feb 14, 2026
685854f
Update TEST_COVERAGE_SUMMARY.md
jnahian Feb 14, 2026
773ed28
chore: update dependencies and devDependencies in package.json
jnahian Feb 16, 2026
2c9b8ca
test: Add comprehensive pollService test coverage with 28 tests
jnahian Feb 16, 2026
fe0b727
Add comprehensive tests for templateService
jnahian Feb 16, 2026
d9f710f
test: add comprehensive tests for pollMessage block builders
jnahian Feb 16, 2026
170c4e4
test: add comprehensive tests for resultsDM block builders
jnahian Feb 16, 2026
ee18ff6
Add vote action handler integration tests with 18 test cases
jnahian Feb 16, 2026
e9eef59
test: add integration tests for poll management actions
jnahian Feb 16, 2026
5849a5c
test: add comprehensive /askify command handler tests
jnahian Feb 16, 2026
fe0caac
test: add poll creation modal submission tests
jnahian Feb 16, 2026
5eab9f3
test: add background cron job tests
jnahian Feb 16, 2026
b21f059
✅ test: add comprehensive tests for event handlers
jnahian Feb 16, 2026
ae6c3e6
✅ test: add comprehensive tests for 8 action handlers
jnahian Feb 16, 2026
a50d0c0
✅ test: add comprehensive tests for poll creation modal builder
jnahian Feb 16, 2026
f9d4a89
✅ test: add tests for poll edit submission handler
jnahian Feb 16, 2026
837efc3
✅ test: add comprehensive tests for reminderJob
jnahian Feb 16, 2026
ba37fb1
✅ test: add comprehensive tests for startupRecovery job
jnahian Feb 16, 2026
7afbf00
✅ test: add edge case tests for voteService utility functions
jnahian Feb 16, 2026
e0393c6
✅ test: add comprehensive tests for requestLogger middleware
jnahian Feb 16, 2026
6e97571
✅ test: add tests for healthServer
jnahian Feb 16, 2026
71a621e
✅ test: add comprehensive edge case tests for validation paths
jnahian Feb 16, 2026
9103fbb
📝 docs: update TEST_COVERAGE_SUMMARY with final results
jnahian Feb 16, 2026
08c02df
✅ test: add action handler edge cases for error paths
jnahian Feb 16, 2026
558eafc
✅ test: add final edge case for pollCreationSubmission
jnahian Feb 16, 2026
06252ad
✅ test: add complex branch combination tests
jnahian Feb 16, 2026
683b767
📝 docs: update TEST_COVERAGE_SUMMARY with final 92% coverage
jnahian Feb 16, 2026
ffe88fd
Update __tests__/fixtures/testData.ts
jnahian Feb 17, 2026
6f84d2b
Update __tests__/setup.ts
jnahian Feb 17, 2026
1c5dc55
Address code review feedback: improve mocks, fix template factory, re…
Copilot Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on:
pull_request:
branches: [main, develop]
push:
branches: [main, develop]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write

strategy:
matrix:
node-version: [22.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Generate Prisma Client
run: npm run prisma:generate

- name: Run type check
run: npx tsc --noEmit

- name: Run tests
run: npm run test:ci

- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Thumbs.db
*.log
npm-debug.log*

# Test coverage
coverage/
*.lcov

/src/generated/prisma

# Github action ssh key
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Askify

[![Tests](https://github.com/jnahian/askify-bot/actions/workflows/test.yml/badge.svg)](https://github.com/jnahian/askify-bot/actions/workflows/test.yml)

An internal Slack poll bot for team decisions, engagement, and feedback.

## Features
Expand Down Expand Up @@ -135,6 +137,37 @@ See [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) for Docker deployment instructions.
| ORM | Prisma v7 with `@prisma/adapter-pg` |
| Scheduler | node-cron |
| Deployment | Docker |
| Testing | Jest + ts-jest |

## Testing

Askify uses Jest for unit and integration testing.

```bash
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run test:ci # Run tests in CI mode
```

### Test Structure

```
__tests__/
fixtures/ # Test data factories
mocks/ # Mock utilities (Prisma, Slack client)
utils/ # Tests for utility functions
services/ # Tests for service layer
blocks/ # Tests for Block Kit message builders
actions/ # Tests for action handlers
commands/ # Tests for command handlers
views/ # Tests for modal views
events/ # Tests for event handlers
jobs/ # Tests for background jobs
middleware/ # Tests for middleware
```

For detailed testing guidelines, see [TESTING.md](TESTING.md).

## Documentation

Expand Down
Loading