Development
tests
Test automation and quality assurance
tests
Comprehensive testing framework for unit tests, integration tests, and end-to-end tests with coverage reporting and CI/CD integration.
Overview
The tests primitive provides a complete testing solution including test runners, assertion libraries, mocking, coverage analysis, and integration with CI/CD pipelines.
Quick Example
import { test, expect } from 'sdk.do'
// Unit test
test('should create order', async () => {
const order = await createOrder({
customerId: 'user-123',
items: [{ productId: 'p1', quantity: 2 }],
})
expect(order.id).toBeDefined()
expect(order.total).toBe(99.98)
})
// Integration test
test('should process payment workflow', async () => {
const result = await workflow.execute('payment', {
orderId: 'order-123',
amount: 99.99,
})
expect(result.status).toBe('completed')
expect(result.transactionId).toBeDefined()
})
// Run tests
await test.run({
pattern: '**/*.test.ts',
coverage: true,
})Core Capabilities
- Test Runners - Run unit, integration, and E2E tests
- Assertions - Rich assertion library for all test types
- Mocking & Stubbing - Mock functions, modules, and APIs
- Coverage Analysis - Code coverage reporting
- CI/CD Integration - Seamless integration with pipelines
Access Methods
SDK
TypeScript/JavaScript library for testing
test('should create order', async () => {
expect(order.id).toBeDefined()
})CLI
Command-line tool for running tests
do test run --pattern "**/*.test.ts" --coverageAPI
REST/RPC endpoints for test execution
curl -X POST https://api.do/v1/tests/run -d '{"pattern":"**/*.test.ts"}'MCP
Model Context Protocol for AI-driven testing
Run all tests matching pattern "**/*.test.ts" with coverage enabledRelated Primitives
- sandbox - Isolated test environments
- workflows - Workflow testing
- deployments - Pre-deployment testing