This is a a minimal package for writing tests. At this time this package is not intended to be publicly used as the API will take time to stabilize.
- Cancel any StreamQueue that is created as a part of a stream matcher once it
is done matching.
- This fixes a bug where using a matcher on a custom stream controller and
then awaiting the
close()method on that controller would hang.
- This fixes a bug where using a matcher on a custom stream controller and then awaiting the
- Avoid causing the test runner to hang if there is a timeout during a
tearDowncallback following a failing test case.
- Bump minimum SDK to
2.4.0for safer usage of for-loop elements.
- Work around a bug in the
2.3.0SDK by avoiding for-loop elements at the top level.
- Link to docs on setting timeout when a test times out with the default duration.
- No longer directly depend on
- Extend the timeout for synthetic tests, e.g.
- Update to latest
package:matcher. Improves output for instances of private classes.
- Treat non-solo tests as skipped so they are properly reported.
- Remove logic which accounted for a race condition in state change. The logic
was required because
package:sseused to not guarantee order. This is no longer the case.
- Prepare for upcoming
Stream<List<int>>changes in the Dart SDK.
package:test_apias deprecated to prevent accidental use.
- Don't swallow exceptions from callbacks in
- Internal cleanup - fix lints.
- Fixed a race condition that caused tests to occasionally fail during
tearDownAllwith the message
(tearDownAll) - did not complete [E].
- Expose the
SuitePlatformclasses publicly through a new
- Update to matcher version
- Require Dart SDK
- Remove "runner" extensions.
test_apiframes by default.
- Initial release of
test_api. Provides the basic API for writing tests and touch points for implementing a custom test runner.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: test_api: ^0.2.15
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
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]
We analyzed this package on Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.6
lib/src/frontend/throws_matchers.dart. (-5.36 points)
lib/src/frontend/throws_matchers.dart reported 11 hints, including:
line 10 col 37: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
line 14 col 5: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
line 18 col 5: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
line 21 col 33: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
line 24 col 39: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
lib/src/frontend/expect.dart. (-2.48 points)
lib/src/frontend/expect.dart reported 5 hints:
line 59 col 47: 'ErrorFormatter' is deprecated and shouldn't be used. Will be removed in 0.13.0..
line 80 col 49: 'ErrorFormatter' is deprecated and shouldn't be used. Will be removed in 0.13.0..
line 85 col 12: 'formatFailure' is deprecated and shouldn't be used. Will be removed in 0.13.0..
line 123 col 12: 'formatFailure' is deprecated and shouldn't be used. Will be removed in 0.13.0..
line 128 col 14: 'formatFailure' is deprecated and shouldn't be used. Will be removed in 0.13.0..
lib/src/frontend/async_matcher.dart. (-0.50 points)
lib/src/frontend/async_matcher.dart reported 1 hint:
line 43 col 16: 'formatFailure' is deprecated and shouldn't be used. Will be removed in 0.13.0..
lib/src/frontend/spawn_hybrid.dart. (-0.50 points)
lib/src/frontend/spawn_hybrid.dart reported 1 hint:
line 12 col 1: 'package:test_api/test_api.dart' is deprecated and shouldn't be used. package:test_api is not intended for general use. Please use package:test..
lib/src/frontend/throws_matcher.dart. (-0.50 points)
lib/src/frontend/throws_matcher.dart reported 1 hint:
line 38 col 29: 'Throws' is deprecated and shouldn't be used. Will be removed in 0.13.0.
The package description is too short. (-20 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
test_api.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.4.0 <3.0.0|