Skip to main content

Dart server quality system / 01

Make every request prove itself.

A sharp, framework-agnostic testing toolkit for Dart HTTP backends — from the first in-memory assertion to a full browser journey.

REQUEST / 001 LIVE
server_test.dart
serverTest('checkout returns an order',
(client, _) async {
final response = await client
.post('/checkout', body: payload);

response
.assertStatus(201)
.assertJsonPath('order.status', 'paid');
},
handler: handler,
);
1 test passed · 38ms

same handler memory / HTTP / browser

Built for Dart backendsSCROLL TO INSPECT v0.3 · open source · MIT

The toolkit

Less test plumbing.
More useful signal.

Every layer is designed to compose, so the test you write at the edge still feels like the code you own in production.

01

Fast by default

Exercise handlers in memory for feedback that stays tight, then switch to a real ephemeral server when the network is part of the behavior.

02

Assertions with signal

Read failures like a story. Status, headers, JSON paths, schemas, uploads, and numeric values all fit one fluent response API.

03

The browser is included

Move from an API check to a real WebDriver flow without changing how your handler is wired or where your test data lives.

04

One handler, every surface

Implement `RequestHandler` once. Reuse it in in-memory tests, HTTP tests, and browser sessions — framework-agnostic by design.

05

Boundaries you can trust

Schema validation and focused response assertions make contracts explicit before a regression finds them for you.

06

Tooling that stays out of the way

Install browsers, drivers, and test scaffolds from the CLI, then get back to testing the behavior that matters.

Start with one command

A better first test
is closer than you think.

Add the core harness. Add the Shelf bridge only if your server speaks Shelf. Nothing else is required.

See the setup guide
shellcopy / paste / run
dart pub add --dev server_testing

# For Shelf applications
dart pub add --dev server_testing_shelf
ADAPTER / 02

Already on Shelf?

Bring your app.
Keep your handler.

server_testing_shelf translates Shelf requests and responses into the same testing surface. Your app stays familiar; your tests get the full toolkit.

Explore the Shelf adapter