test_api
The user facing API for structuring Dart tests and checking expectations.
0.7.13
11M downloads/mo
#14 most downloaded on pub.dev
dart-lang/test
What this package is like to depend on
Last release 1 months ago
27 Jun 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 63 of 63 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
70 releases · first in 2018
6 releases in the last 12 months
see the full history below
Release timeline
70 releases · Oct 2018 to Jun 2026
2019
2020
2021
2022
2023
2024
2025
2026
Releases
latest 60 of 70-
0.7.1327 Jun 2026Release notes
Open source →- Add
Compiler.cli(the native CLI compiler). - Expose several more backend APIs for use in
flutter_test. - Allow using browser platforms with a specified OS.
Release notes
Open source →- Add
Compiler.cli(the native CLI compiler). - Expose several more backend APIs for use in
flutter_test. - Allow using browser platforms with a specified OS.
- Add
-
0.7.1227 Apr 2026 -
0.7.1118 Mar 2026Release notes
Open source →- Add
vmAsan,vmMsanandvmTsanruntimes. - Change return type on the
bodycallback argument togrouptovoidfrom
dynamic. This may surface cases where the group callback was erroneously
returning an ignored value. - Require
analyzer: '>=8.0.0 <13.0.0'
Release notes
Open source →- Add
vmAsan,vmMsanandvmTsanruntimes. - Change return type on the
bodycallback argument togrouptovoidfromdynamic. This may surface cases where the group callback was erroneously returning an ignored value.
- Add
-
0.7.1027 Feb 2026 -
0.7.907 Jan 2026 -
0.7.811 Nov 2025Release notes
Open source →- Add a zone function available from the test suite
mainthat allows creating channels to the test runner. - Require Dart 3.7
- Allow
analyzermajor version 9.
- Add a zone function available from the test suite
-
0.7.721 Jul 2025 -
0.7.619 May 2025Release notes
Open source →- Fix an assertion failure when using
setUpAllortearDownAlland running with asserts enabled.
- Fix an assertion failure when using
-
0.7.512 May 2025Release notes
Open source →test()andgroup()functions now take an optionalTestLocationthat will be used as the location of the test in JSON reporters instead of being parsed from the call stack.
-
0.7.426 Nov 2024Release notes
Open source →- Allow
analyzer: '>=6.0.0 <8.0.0' - Increase SDK constraint to ^3.5.0.
- Support running Node.js tests compiled with dart2wasm.
- Allow
-
0.7.303 Jul 2024 -
0.7.202 Jun 2024 -
0.7.108 Apr 2024Release notes
Open source →- Added
@doNotSubmittotest(solo: ...)andgroup(solo: ...). In practice, this means that code that was relying on ignoring deprecation warnings and usingsoloorgroupwith askipparameter will now fail ifdart analyze --fatal-infos(or similar) is enabled.
- Added
-
0.7.013 Dec 2023Release notes
Open source →- Deprecate
Runtime.internetExplorer. - Added
dart2wasmas a supported compiler for thechromeruntime. - BREAKING: Removed the
experimentalChromeWasmruntime. - BREAKING: Removed
Runtime.isJSandRuntime.isWasm, as this is now based on the compiler and not the runtime.
- Deprecate
-
0.6.128 Jun 2023Release notes
Open source →- Drop support for null unsafe Dart, bump SDK constraint to
3.0.0. - Make some implementation classes
final. These classes were never intended to be extended or implemented.Metadata,PlatformSelector,RemoteListener,Runtime,StackTraceFormatter,SuitePlatform,RemoteException,TestHandle,OutstandingWork,OutsideTestException,OnPlatform,Retry,Skip,Tags,TestOn,Timeout. - Mark an implementation class
interface:StackTraceMapper. - Change the
Compilerclass into anenum. - Make
Fakeamixin class. - Allow the latest analyzer (6.x.x).
- Drop support for null unsafe Dart, bump SDK constraint to
-
0.6.016 May 2023Release notes
Open source →- Remove the
package:test_api/expect.dart' library.testwill export frompackage:matcher` directly. - Fix compatibility with wasm number semantics.
- Remove the
-
0.5.219 Apr 2023Release notes
Open source →- Remove deprecation for the
scaffolding.dartandbackend.dartlibraries. - Export
registerExceptionfrom thescaffolding.dartlibrary.
- Remove deprecation for the
-
0.5.131 Mar 2023Release notes
Open source →- Handle a missing
'compiler'value when running a test compiled against a newertest_apithan the runner back end is using. The expectation was that the json protocol is only used across packages compatible with the same major version of thetest_apipackage, butflutter testdoes not check the version of packages in the pub solve for user test code.
- Handle a missing
-
0.5.023 Mar 2023Release notes
Open source →- Add
Compilerclass, exposed throughbackend.dart. - Support compiler identifiers in platform selectors.
- Add
compilerfield toSuitePlatform. This will become required in the next major release. - BREAKING Add required
defaultCompilerandsupportedCompilersfields toRuntime. - Add
package:test_api/hooks_testing.dartlibrary for writing tests against code that usespackage:test_api/hooks.dart. - BREAKING Remove
ErrorFormatter,expectAsync,throws, andThrowsfrompackage:test_api/test_api.dart.
- Add
-
0.4.1811 Jan 2023Release notes
Open source →- Don't run
tearDownuntil the test body and outstanding work is complete, even if the test has already failed.
- Don't run
-
0.4.1708 Dec 2022Release notes
Open source →- Deprecate
throwsNullThrownError, usethrowsA(isA<TypeError>())instead. The implementation has been changed to ease migrations. - Deprecate
throwsCyclicInitializationErrorand replace the implementation withThrows(TypeMatcher<Error>()). The specific exception no longer exists and there is no guarantee about what type of error will be thrown.
- Deprecate
-
0.4.1601 Nov 2022Release notes
Open source →- Add the
experimental-chrome-wasmruntime. This is very unstable and will eventually be deleted, to be replaced by a--compilerflag. See https://github.com/dart-lang/test/issues/1776 for more information on future plans - Add
isWasmfield toRuntime(defaults tofalse).
- Add the
-
0.4.1526 Oct 2022Release notes
Open source →- Expand the pubspec description.
- Support
package:matcherversion0.12.13.
-
0.4.1412 Sep 2022 -
0.4.1319 Aug 2022 -
0.4.1206 Jul 2022 -
0.4.1122 Jun 2022 -
0.4.1015 Jun 2022 -
0.4.916 Dec 2021Release notes
Open source →- Add
ignoreTimeoutsoption toSuite, which disables all timeouts for all tests in that suite.
- Add
-
0.4.824 Nov 2021Release notes
Open source →TestFailureimplementsExceptionfor compatibility withonly_throw_exceptions.
-
0.4.702 Nov 2021Release notes
Open source →- Remove logging about enabling the chain-stack-traces flag from the invoker.
-
0.4.620 Oct 2021Release notes
Open source →- Give a better exception when using
markTestSkippedoutside of a test. - Format stack traces if a formatter is available when serializing tests and groups from the remote listener.
- Give a better exception when using
-
0.4.501 Oct 2021Release notes
Open source →- Add defaulting for older test backends that don't pass a configuration for
the
allow_duplicate_test_namesparameter to the remote listener.
- Add defaulting for older test backends that don't pass a configuration for
the
-
0.4.430 Sep 2021 -
0.4.316 Aug 2021 -
0.4.213 Jul 2021 -
0.4.109 Jun 2021Release notes
Open source →- Give a better error when
printOnFailureis called from outside a test zone.
- Give a better error when
-
0.4.021 Apr 2021Release notes
Open source →- Add libraries
scaffolding.dart, andexpect.dartto allow importing as subset of the normal surface area. - Add new APIs in
hooks.dartto allow writing custom expectation frameworks which integrate with the test runner. - Add examples to
throwsAand make top-levelthrows...matchers refer to it. - Disable stack trace chaining by default.
- Fix
expectAsyncfunction type checks. - Add
RemoteException,RemoteListener,StackTraceFormatter, andStackTraceMappertobackend.dart. - Breaking remove
Runtime.phantomJS - Breaking Add callback to get the suite channel in the
beforeLoadcallback ofRemoteListener.start. This is now used in place of using zones to communicate the value.
- Add libraries
-
0.3.009 Mar 2021Release notes
Open source →- Breaking
TestException.messageis now nullable.- Fixes handling of
nullmessages in remote exceptions.
- Fixes handling of
- Breaking
-
0.2.2008 Mar 2021 -
0.2.1903 Feb 2021 -
0.2.19-nullsafety.702 Feb 2021 pre-release -
0.2.19-nullsafety.605 Nov 2020 pre-release -
0.2.19-nullsafety.503 Nov 2020 pre-releaseRelease notes
Open source →- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
- Update SDK constraints to
-
0.2.19-nullsafety.423 Oct 2020 pre-release -
0.2.19-nullsafety.321 Oct 2020 pre-releaseRelease notes
Open source →- Add capability to filter to a single exact test name in
Declarer. - Add
markTestSkippedAPI.
- Add capability to filter to a single exact test name in
-
0.2.19-nullsafety.222 Sep 2020 pre-releaseRelease notes
Open source →- Allow
2.10stable and2.11.0-devSDKs. - Annotate the classes used as annotations to restrict their usage to library level.
- Allow
-
0.2.19-nullsafety29 Jul 2020 pre-releaseRelease notes
Open source →- Migrate to NNBD.
- The vast majority of changes are intended to express the pre-existing behavior of the code regarding to handling of nulls.
- Breaking Change:
GroupEntry.nameis no longer nullable, the root group now has the empty string as its name.
- Add the
Fakeclass, available throughpackage:test_api/fake.dart. This was previously part of the Mockito package, but with null safety it is useful enough that we decided to make it available throughpackage:test. In a future release it will be made available directly throughpackage:test_api/test_api.dart(and hence throughpackage:test_core/test_core.dartandpackage:test/test.dart).
- Migrate to NNBD.
-
0.2.1815 Jul 2020 -
0.2.18+111 Nov 2020 -
0.2.1717 Jun 2020Release notes
Open source →- Add
languageVersionCommenton theMetaDataclass. This should only be present for test suites.
- Add
-
0.2.1622 May 2020Release notes
Open source →- Deprecate
LiveTestController.liveTest, theLiveTestControllerinstance now implementsLiveTestand can be used directly.
- Deprecate
-
0.2.1502 Mar 2020Release notes
Open source →- 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.
- Cancel any StreamQueue that is created as a part of a stream matcher once it
is done matching.
-
0.2.1404 Feb 2020 -
0.2.1319 Jan 2020Release notes
Open source →- Work around a bug in the
2.3.0SDK by avoiding for-loop elements at the top level.
- Work around a bug in the
-
0.2.1208 Jan 2020Release notes
Open source →- Link to docs on setting timeout when a test times out with the default duration.
- No longer directly depend on
package:pedantic.
-
0.2.1107 Nov 2019 -
0.2.1023 Oct 2019Release notes
Open source →- Update to latest
package:matcher. Improves output for instances of private classes.
- Update to latest
-
0.2.916 Oct 2019 -
0.2.823 Sep 2019Release notes
Open source →- 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.
- Remove logic which accounted for a race condition in state change. The logic
was required because