Commit bb2c509
test: Add comprehensive test suite with Vitest
Add unit tests for core MCP server functionality:
Test Coverage:
- Tool schema validation (25 tests)
- All 6 MCP tools with valid/invalid inputs
- Tool array structure and metadata
- API client methods (22 tests)
- All CRUD operations with mocked fetch
- Error handling (401, 403, 422, 500, network)
- Request formatting and headers
- MCP server factory (4 tests)
- Server instantiation and configuration
Infrastructure:
- Add Vitest testing framework (@vitest/ui for debugging)
- Add vitest.config.ts with coverage configuration
- Update package.json with test scripts:
- npm test: Run tests once
- npm run test:watch: Watch mode
- npm run test:coverage: Coverage report
- npm run test:ui: Interactive UI
- Add test step to CI workflow (all Node versions)
- Update README with testing documentation
Results: 51 tests passing across 3 test suites
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent e443bf2 commit bb2c509
File tree
8 files changed
+1716
-7
lines changed- .github/workflows
- src/__tests__
8 files changed
+1716
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
164 | 173 | | |
165 | | - | |
| 174 | + | |
166 | 175 | | |
167 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
168 | 181 | | |
169 | | - | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
176 | | - | |
| 189 | + | |
177 | 190 | | |
178 | 191 | | |
179 | 192 | | |
| |||
193 | 206 | | |
194 | 207 | | |
195 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
196 | 232 | | |
197 | 233 | | |
198 | 234 | | |
| |||
0 commit comments