testainers 0.0.4 copy "testainers: ^0.0.4" to clipboard
testainers: ^0.0.4 copied to clipboard

Testainers is a powerful Dart plugin designed to streamline the management of containers for testing purposes.

example/testainers_example.dart

import 'dart:io';

import 'package:test/test.dart';
import 'package:testainers/testainers.dart';

import '../helpers/http_service.dart';

///
///
///
void main() {
  ///
  ///
  ///
  group('Test HttpBin', () {
    final TestainersHttpBin container = TestainersHttpBin();
    final HttpService httpService = HttpService();

    ///
    setUpAll(() async {
      await container.start();
    });

    ///
    test('First Test', () async {
      final HttpClientResponse response = await httpService
          .get(Uri.parse('http://localhost:${container.httpPort}'));

      expect(response.statusCode, 200);
      expect(response.headers.value('date'), isNotEmpty);
      expect(response.contentLength, greaterThan(0));
    });

    ///
    tearDownAll(() {
      httpService.close();
      container.stop();
    });
  });
}
6
likes
0
pub points
8%
popularity

Publisher

verified publishertestainers.com

Testainers is a powerful Dart plugin designed to streamline the management of containers for testing purposes.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on testainers