| name | clade-ci-integration |
| description | Test and validate Claude integrations in CI/CD pipelines —
Use when working with ci-integration patterns.
GitHub Actions, mocking strategies, and cost control.
Trigger with "anthropic ci", "test claude in ci", "anthropic github actions",
"claude automated testing".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*) |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","anthropic","claude","ci","testing"] |
| compatibility | Designed for Claude Code |
Anthropic CI Integration
Overview
Testing Claude integrations in CI requires handling API keys securely, mocking for unit tests, and making real calls only in integration tests.
GitHub Actions Setup
name: Test Claude Integration
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run test:unit
- run: npm run test:integration
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Mock Strategy for Unit Tests
import { vi } from 'vitest';
() {
{
: {
: vi.().({
: ,
: ,
: ,
: ,
: [{ : , : }],
: ,
: { : , : },
}),
: vi.().({
*[.]() {
{ : , : { : , : } };
},
: vi.().({ : { : , : } }),
}),
},
};
}
{ mockAnthropicClient } ;
(, () => {
client = ();
result = (client, );
(result).();
(client..).(
expect.({ : })
);
});