aim_server_testing
Testing utilities for the Aim framework. Provides test helpers, matchers, and mock objects for testing Aim applications.
0.1.1
aim-dart/aim
What this package is like to depend on
Last release 7 months ago
20 Jan 2026
Too new to tell
only 2 dated releases
Nearly every release is documented
notes for 2 of 2 stable releases
Nothing withdrawn
no release was ever pulled
8 months old
2 releases · first in 2025
2 releases in the last 12 months
see the full history below
Release timeline
2 releases · Dec 2025 to Jan 2026Releases
latest 2-
0.1.120 Jan 2026 -
0.1.025 Dec 2025Release notes
Open source →Changelog
0.1.0
First beta release of Aim Framework - a modular ecosystem for Dart.
Highlights
- Lightweight, fast web server framework
- Native PostgreSQL driver (no external dependencies)
- Type-safe ORM with Record syntax
- CLI tools with hot reload and database migrations
Web Server (aim_server)
- HTTP server built on Dart's native
HttpServer - Path-based routing with parameter support (
/users/:id) - Composable middleware chain
- JSON, text, HTML response handling
- Real-time SSE streaming support
- Custom error handlers (404, global)
Middleware Packages
- aim_server_cors: CORS configuration
- aim_server_cookie: Secure cookie management
- aim_server_form: Form data parsing
- aim_server_multipart: File upload handling
- aim_server_static: Static file serving
- aim_server_logger: HTTP request logging
- aim_server_sse: Server-Sent Events
- aim_server_jwt: JWT authentication
- aim_server_basic_auth: Basic authentication
Testing (aim_server_testing)
- Test helpers and matchers
- Mock objects for unit testing
- Integration test utilities
Database (aim_database + aim_postgres)
- Database abstraction layer
- Native PostgreSQL Wire Protocol implementation
- SSL/TLS support (disable, allow, prefer, require, verify-ca, verify-full)
- Authentication: cleartext, MD5, SCRAM-SHA-256
- Named parameters (
:name) and positional parameters ($1) - Transaction support with automatic commit/rollback
ORM (aim_orm + aim_orm_postgres + aim_orm_codegen)
- Type-safe table definitions using Dart Record syntax
- Column types:
integer,bigint,varchar,text,boolean,timestamp,uuid,json - Column modifiers:
primaryKey,unique,nullable,withDefault,indexed - Query builders: SELECT, INSERT, UPDATE, DELETE
- Condition operators:
eq,gt,lt,gte,lte,inList - Code generation with
build_runner
CLI (aim_cli)
aim create <name>: Project scaffoldingaim dev: Development server with hot reloadaim build: Production build with native compilationaim db:generate: Migration SQL generation from schema diffaim db:migrate: Apply pending migrationsaim db:rollback: Rollback migrationsaim db:status: Show migration status
Known Limitations
- ORM Relations (1:1, 1:N, N:N) not yet supported
- SQLite driver not yet available
db:resetcommand not yet implemented
Requirements
- Dart SDK:
^3.10.0 - PostgreSQL: 9.5+ (SCRAM-SHA-256 requires 10+)
Release notes
Open source →First beta release of Aim Framework - a modular ecosystem for Dart.
Highlights
- Lightweight, fast web server framework
- Native PostgreSQL driver (no external dependencies)
- Type-safe ORM with Record syntax
- CLI tools with hot reload and database migrations
Web Server (aim_server)
- HTTP server built on Dart's native
HttpServer - Path-based routing with parameter support (
/users/:id) - Composable middleware chain
- JSON, text, HTML response handling
- Real-time SSE streaming support
- Custom error handlers (404, global)
Middleware Packages
- aim_server_cors: CORS configuration
- aim_server_cookie: Secure cookie management
- aim_server_form: Form data parsing
- aim_server_multipart: File upload handling
- aim_server_static: Static file serving
- aim_server_logger: HTTP request logging
- aim_server_sse: Server-Sent Events
- aim_server_jwt: JWT authentication
- aim_server_basic_auth: Basic authentication
Testing (aim_server_testing)
- Test helpers and matchers
- Mock objects for unit testing
- Integration test utilities
Database (aim_database + aim_postgres)
- Database abstraction layer
- Native PostgreSQL Wire Protocol implementation
- SSL/TLS support (disable, allow, prefer, require, verify-ca, verify-full)
- Authentication: cleartext, MD5, SCRAM-SHA-256
- Named parameters (
:name) and positional parameters ($1) - Transaction support with automatic commit/rollback
ORM (aim_orm + aim_orm_postgres + aim_orm_codegen)
- Type-safe table definitions using Dart Record syntax
- Column types:
integer,bigint,varchar,text,boolean,timestamp,uuid,json - Column modifiers:
primaryKey,unique,nullable,withDefault,indexed - Query builders: SELECT, INSERT, UPDATE, DELETE
- Condition operators:
eq,gt,lt,gte,lte,inList - Code generation with
build_runner
CLI (aim_cli)
aim create <name>: Project scaffoldingaim dev: Development server with hot reloadaim build: Production build with native compilationaim db:generate: Migration SQL generation from schema diffaim db:migrate: Apply pending migrationsaim db:rollback: Rollback migrationsaim db:status: Show migration status
Known Limitations
- ORM Relations (1:1, 1:N, N:N) not yet supported
- SQLite driver not yet available
db:resetcommand not yet implemented
Requirements
- Dart SDK:
^3.10.0 - PostgreSQL: 9.5+ (SCRAM-SHA-256 requires 10+)
Release notes
Open source →Major Refactoring
- Simplified TestClient implementation: Refactored to use
Aim.handle()method instead of reimplementing middleware chain- Reduced code complexity by ~40% (253 lines → 145 lines)
- Removed internal
_executeMiddlewareChainmethod (~70 lines) - Improved maintainability by reducing dependency on Aim's internal implementation
New Features
TestResponse Enhancements
- Body caching: Response body is now cached after first read (Stream can only be read once)
- Detailed status code helpers (properties):
isOk- 200 OKisCreated- 201 CreatedisNoContent- 204 No ContentisBadRequest- 400 Bad RequestisUnauthorized- 401 UnauthorizedisForbidden- 403 ForbiddenisNotFound- 404 Not FoundisInternalServerError- 500 Internal Server Error
- JSON accessors:
jsonMap- Get response body as JSON Map (cached)jsonList- Get response body as JSON List (cached)
Custom Matchers
- Specific status code matchers:
isOk()- 200 OKisCreated()- 201 CreatedisNoContent()- 204 No ContentisBadRequest()- 400 Bad RequestisUnauthorized()- 401 UnauthorizedisForbidden()- 403 ForbiddenisNotFound()- 404 Not FoundisInternalServerError()- 500 Internal Server Error
Breaking Changes
- Removed test_middleware.dart: Removed internal testing utilities that were not useful for application developers
- Removed
SpyMiddleware,ExecutionTracker,conditionalMiddleware,timeoutMiddleware,headerMiddleware,errorThrowingMiddleware,mockAuthMiddleware - Focus shifted to core testing functionality:
TestClient,TestRequestBuilder, and matchers
- Removed
Dependencies
- Updated
aim_serverdependency from0.0.4to0.0.5
Migration Guide
Body Caching
No migration needed. Body methods now cache automatically:
final response = await client.get('/data'); final body1 = await response.bodyAsString(); // Reads from stream final body2 = await response.bodyAsString(); // Returns cached valueNew Status Helpers
Use new convenience helpers instead of
hasStatus():// Before expect(response, hasStatus(200)); expect(response, hasStatus(201)); // After (more readable) expect(response, isOk()); expect(response, isCreated()); // Or use properties expect(response.isOk, isTrue); expect(response.isCreated, isTrue);Removed Test Middleware
If you were using test middleware helpers, replace them with custom implementations:
// SpyMiddleware replacement (if needed) final callCount = 0; app.use((c, next) async { callCount++; await next(); });