jaspr_test 0.1.0 copy "jaspr_test: ^0.1.0" to clipboard
jaspr_test: ^0.1.0 copied to clipboard

outdated

Testing utilities for jaspr.

jaspr_test #

Testing utilities for the jaspr framework.

A simple component test looks like this:

import 'package:jaspr_test/jaspr_test.dart';

import 'app.dart';

void main() {
  group('simple component test', () {
    late ComponentTester tester;

    setUp(() {
      TestComponentsBinding.setUp();
      tester = TestComponentsBinding.instance.tester;
    });

    test('should render component', () async {
      await tester.pumpComponent(App());

      expect(find.text('Count: 0'), findsOneComponent);

      await tester.click(find.tag('button'));

      expect(find.text('Count: 1'), findsOneComponent);
    });
  });
}

Checkout the tests use by jaspr itself for more examples: jaspr/test