brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
testing-integrationExecutes integration tests to validate combined components and their interactions in a system, ensuring workflows operate seamlessly.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: testing-integration description: Executes integration tests to validate combined components and their interactions in a system, ensuring workflows operate seamlessly. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: integration testing, integration tests, system testing, workflows role: implementation scope: implementation output-format: code related-skills: testing-unit, testing-contract, testing-end-to-end archetypes: tactical, diagnostic anti_triggers: unit testing, manual testing, load testing response_profile: verbosity: medium directive_strength: high abstraction_level: tactical
Implement integration testing to ensure that different modules or services within an application work together as expected. Focus on testing the flow of data and control between modules.
Postman for APIs, Jest for Node.js).
# For Node.js
npm install jest --save-dev
const request = require('supertest');
const app = require('../app');
describe('API Integration Tests', () => {
it('should return 200 on valid request', async () => {
const response = await request(app).get('/api/data');
expect(response.statusCode).toBe(200);
});
});
npm test
const request = require('supertest');
const app = require('../app');
describe('GET /api/users', () => {
it('responds with json', async () => {
const res = await request(app)
.get('/api/users')
.expect('Content-Type', /json/)
.expect(200);
expect(res.body).toHaveProperty('users');
});
});
httpx or supertest) rather than calling controller functions directly — this validates routing, middleware, and serialization.tests/integration/ vs tests/unit/) and separate CI jobs to run them at different cadences.Python's httpx library pairs naturally with pytest for HTTP-level integration testing:
import pytest
import httpx
BASE_URL = "http://localhost:8000"
@pytest.fixture
async def client():
"""Provide an async HTTP client for integration tests."""
async with httpx.AsyncClient(base_url=BASE_URL) as client:
yield client
@pytest.mark.asyncio
async def test_get_users_returns_200(client: httpx.AsyncClient):
"""Verify GET /api/users returns a list of users."""
response = await client.get("/api/users")
assert response.status_code == 200
data = response.json()
assert "users" in data
assert isinstance(data["users"], list)
@pytest.mark.asyncio
async def test_create_user_persists_data(client: httpx.AsyncClient):
"""Verify POST /api/users creates and returns a new user."""
payload = {"name": "Alice", "email": "alice@example.com"}
response = await client.post("/api/users", json=payload)
assert response.status_code == 201
created = response.json()
assert created["name"] == "Alice"
assert created["id"] is not None
@pytest.mark.asyncio
async def test_get_nonexistent_user_returns_404(client: httpx.AsyncClient):
"""Verify 404 for a non-existent user ID."""
response = await client.get("/api/users/99999")
assert response.status_code == 404
Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.