Home

Awesome

OverReact Test

Pub Build Status 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. Run your tests:

    $ dart run test test/your_test_file.dart
    

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

Example:

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:

Documentation

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.

Contributing

Yes please! (Please read our contributor guidelines first)

Versioning

The over_react_test library adheres to Semantic Versioning: