Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 27 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -27,4 +30,27 @@ jobs:
run: npm run build

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

functional-test:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "23"

- name: Install dependencies
run: npm ci

- name: Compile typescript
run: npm run build

- name: Run functional tests
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
run: npm run test:functional
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ dist
.tshy-build/

# Test results
test-results.xml
test-results*.xml

# Build artifacts
*.tsbuildinfo
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Unreleased

### Testing

- **Functional Tests**: Refactored functional tests to import from built npm artifact (`@mapbox/mcp-server/*`) instead of TypeScript source, ensuring tests validate exactly what users consume via the package `exports` map. The `test:functional` script now runs `npm run build` before executing tests.
- **Functional Tests**: Added MCP protocol-level integration tests for all 9 API-based tools
- Tests exercise the full MCP protocol via InMemoryTransport (Client <-> Server)
- Covers tool discovery, tool calls with real Mapbox APIs, resource listing/reading, prompt listing/retrieval
- Dedicated vitest config with 30s timeout, `npm run test:functional`
- CI runs functional tests after unit tests, blocks merge on failure
- Automatically skipped when `MAPBOX_ACCESS_TOKEN` is not set

### Documentation

- **PR Guidelines**: Added CHANGELOG requirement to CLAUDE.md (#112)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"spellcheck": "cspell \"*.md\" \"src/**/*.ts\" \"test/**/*.ts\" \"examples/**/*.ts\"",
"sync-manifest": "node scripts/sync-manifest-version.cjs",
"test": "vitest",
"test:functional": "npm run build && vitest --config test/functional/vitest.functional.config.ts",
"tracing:jaeger:start": "docker run --rm -d --name jaeger -p 16686:16686 -p 14250:14250 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:latest",
"tracing:jaeger:stop": "docker stop jaeger",
"tracing:verify": "node -e \"console.log('🔍 Verifying tracing setup with Jaeger...\\n1. Copy .env.example to .env and add your MAPBOX_ACCESS_TOKEN\\n2. Start Jaeger: npm run tracing:jaeger:start\\n3. Run server: npm run inspect:build\\n4. Check traces at: http://localhost:16686')\""
Expand Down
Loading