Generate integration tests for a module, testing real interactions between components.
- Identify the target module or file from the argument or current context.
- Analyze imports and dependencies to determine what external systems are involved (database, API, filesystem, message queue).
- Detect the test framework in use (Jest, Vitest, pytest, Go testing, etc.) from project config.
- For each public function or endpoint in the module:
- Write a test that exercises the real integration path.
- Set up required test fixtures (seed data, mock servers, temp files).
- Test the happy path with realistic input data.
- Test at least one error/failure scenario per integration point.
- Add proper teardown to clean up test state.
- Group tests logically using
describe/contextblocks. - Add setup and teardown hooks (
beforeAll/afterAll) for shared resources. - Run the generated tests to verify they pass.
Generated: <N> integration tests in <file>
Tests:
- <TestName>: <what it verifies>
- <TestName>: <what it verifies>
Coverage: <modules/functions covered>
- Integration tests must use real dependencies where possible; mock only external services.
- Each test must be independent and not rely on execution order.
- Use realistic test data, not trivial values like "test" or "foo".
- Include timeout configuration for async operations.
- Name test files with
.integration.testor_integration_testsuffix.