conduit_test 5.1.3 copy "conduit_test: ^5.1.3" to clipboard
conduit_test: ^5.1.3 copied to clipboard

Utilities for writing automated tests for Conduit applications

example/main.dart

import 'package:conduit_core/conduit_core.dart';
import 'package:conduit_test/conduit_test.dart';
import 'package:test/test.dart';

void main() {
  final harness = TestHarness<App>()..install();

  test("GET /example returns simple map", () async {
    final response = await harness.agent!.get("/example");
    expectResponse(response, 200, body: {"key": "value"});
  });
}

class App extends ApplicationChannel {
  @override
  Controller get entryPoint {
    final router = Router();
    router
        .route("/example")
        .linkFunction((req) async => Response.ok({"key": "value"}));
    return router;
  }
}
2
likes
150
points
1.16k
downloads

Publisher

verified publishertheconduit.dev

Weekly Downloads

Utilities for writing automated tests for Conduit applications

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

conduit_core, matcher, test

More

Packages that depend on conduit_test