The test suite mirrors src/ and uses Vitest in Node mode. Keep tests shaped around current source behavior, not old test layout.
npm testrunsvitest run --coverage.npm run test:watchstarts Vitest watch mode.npx vitest run tests/path/to/file.test.tsruns one test file.npm run typecheck:alltypechecks source and tests withtsconfig.test.json.npm run format:checkchecks Prettier formatting.
tests/shared/covers framework-free shared utilities.tests/core/covers pipeline runtime behavior.tests/contracts/contains reusable conformance helpers, not standalone test files.tests/builtins/mirrors built-in providers, renderers, and pipeline steps.tests/adapters/http/covers the Fastify host and HTTP adapter built-ins.tests/engine/,tests/app/,tests/config/, andtests/bundles/cover construction and configuration boundaries.tests/architecture/enforces source dependency boundaries.
Built-ins usually split tests by concern: *-config.test.ts for config parsing, *-descriptor.test.ts for descriptor wiring, and *.test.ts for runtime behavior.
tests/helpers/logger.tscaptures structured log calls throughcreateTestLogger().tests/helpers/host-tools.tsbuilds testHostToolswith optional fetch/resource-loader doubles.tests/helpers/app.tsbuilds a Fastify app from HTTP adapter instances.tests/helpers/pipeline.tsbuilds pipeline results, compiled pipelines, renderers, and static pipeline handles.tests/helpers/responses.tscreates JSONResponseobjects for provider tests.tests/builtins/pipeline-steps/utils.tsbuilds directPipelineContextfixtures for step tests.
Use conformance helpers when adding a compatible implementation:
- HTTP adapters bind
runHttpAdapterConformance(...)fromtests/contracts/http-adapter-conformance.ts. - Output renderers call
assertOutputRendererConformance(...)fromtests/contracts/output-renderer-conformance.ts. - Pipeline step descriptor tests call
assertPipelineStepIdentity(...)andassertPipelineStepRunsCleanly(...)fromtests/contracts/pipeline-step-conformance.ts.