over_react_test 1.5.0

  • README.md
  • Installing
  • Versions
  • 8

OverReact Test

Pub Build Status Test Coverage Documentation

A library for testing OverReact components.

Using it in your project

  1. Import it into your test files:

     import 'package:over_react_test/over_react_test.dart';
  2. Add the test/pub_serve transformer to your pubspec.yaml after the over_react transformer.

     - over_react
     - test/pub_serve:
         $include: test/**_test{.*,}.dart
     - $dart2js
  3. Use the --pub-serve option when running your tests:

     $ pub run test --pub-serve=8081 test/your_test_file.dart

    Note: 8081 is the default port used, but your project may use something different. Be sure to take note of the output when running pub serve to ensure you are using the correct port.

Naming Conventions

Variables and Types

UsageActual TypeSuggested Referencing
render and render helper functionsReactComponent |Elementinstance
Component classReactClasstype
VDOM Instance (invoked UiProps)ReactElement-ReactElement or not suffixed
findDomNode, queryByTestId, etc.Elementnode
The Dart componentreact.Component (backed by ReactComponent)dartInstance
Invoked UiFactoryUiPropsbuilder


test('my test' () {
  var sampleBuilder = Sample();
  var sampleReactElement = sampleBuilder(); // Or var sample = sampleBuilder();
  var instance = render(sampleInstance);
  SampleComponent sampleDartInstance = getDartComponent(instance);
  var sampleNode = findDomNode(instance);

Test IDs

When coming up with test ID strings:

  • DO NOT use spaces; space-delimited strings will be treated as separate test IDs

    Just like CSS class names, you can use multiple test IDs together, and use any one of them to target a given component/node.

  • PREFER following our naming scheme for consistency across projects:


    We recommend including a library abbreviation and component name within a test ID so that it's easy to track down where that ID came from.

    Namespacing (.<subpart>) can be added however it makes sense.

    Finally, test IDs should be descriptive and useful in the context of tests.


    • wsd.DatepickerPrimitive.goToSelectedButton
    • sox.AbstractDataLayoutGroup.headerBlock.title
  • CONSIDER adding multiple IDs to serve different purposes

    for (var i = 0; i < items.length; i++) {
      // ...
      // ...

    With the output of above code, you can:

    • target all of the Bar component's menu items using foo.Bar.menuItem
    • target the 4th item using foo.Bar.menuItem.3
    • target the item corresponding to an item with id baz123 using foo.Bar.menuItem.baz123

    This won't always be needed, but it comes in handy in certain cases.


You would never skip reading the docs for a new language you are asked to learn, so please don't skip over reading our API documentation either.


Yes please! (Please read our contributor guidelines first)


The over_react_test library adheres to Semantic Versioning:

  • Any API changes that are not backwards compatible will bump the major version (and reset the minor / patch).
  • Any new functionality that is added in a backwards-compatible manner will bump the minor version (and reset the patch).
  • Any backwards-compatible bug fixes that are added will bump the patch version.

OverReact Test Changelog


Bugs Fixed

  • Sync common component test src with the lib it originated from.


New Features

  • #11: Add some test utilities that were left in over_react when the library was first created.



  • #8: Update prop error message to make it more DDC friendly


Initial public release of library.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  over_react_test: ^1.5.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:over_react_test/over_react_test.dart';
Version Uploaded Documentation Archive
1.5.0 Aug 11, 2018 Go to the documentation of over_react_test 1.5.0 Download over_react_test 1.5.0 archive
1.4.0 May 15, 2018 Go to the documentation of over_react_test 1.4.0 Download over_react_test 1.4.0 archive
1.3.2 May 8, 2018 Go to the documentation of over_react_test 1.3.2 Download over_react_test 1.3.2 archive
1.3.1 Sep 25, 2017 Go to the documentation of over_react_test 1.3.1 Download over_react_test 1.3.1 archive
1.3.0 Sep 22, 2017 Go to the documentation of over_react_test 1.3.0 Download over_react_test 1.3.0 archive
1.2.1 Aug 14, 2017 Go to the documentation of over_react_test 1.2.1 Download over_react_test 1.2.1 archive
1.2.0 Aug 11, 2017 Go to the documentation of over_react_test 1.2.0 Download over_react_test 1.2.0 archive
1.1.1 Jul 27, 2017 Go to the documentation of over_react_test 1.1.1 Download over_react_test 1.1.1 archive
1.1.0 Jul 26, 2017 Go to the documentation of over_react_test 1.1.0 Download over_react_test 1.1.0 archive
1.0.1 Jul 5, 2017 Go to the documentation of over_react_test 1.0.1 Download over_react_test 1.0.1 archive

All 11 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.2 <2.0.0