conduit_test 4.3.0 copy "conduit_test: ^4.3.0" to clipboard
conduit_test: ^4.3.0 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
0
pub points
61%
popularity

Publisher

verified publishertheconduit.dev

Utilities for writing automated tests for Conduit applications

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

conduit_core, matcher, test

More

Packages that depend on conduit_test