pub repository
mirror.p-hatan.irtest_api
0.4.17The user facing API for structuring Dart tests and checking expectations.
Readme
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.
If you're interested in testing Dart code, you likely want to use package:test.
Changelog
0.4.17
- 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.
0.4.16
- 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).
0.4.15
- Expand the pubspec description.
- Support
package:matcherversion0.12.13.
0.4.14
- Require Dart >= 2.18.0
- Support the latest
package:analyzer.
0.4.13
- Fix
printOnFailureoutput to be associated with the correct test.
0.4.12
- Internal cleanup.
0.4.11
- Support the latest version of
package:matcher.
0.4.10
- Add
Targetto restrictTestOnannotation to library level.
0.4.9
- Add
ignoreTimeoutsoption toSuite, which disables all timeouts for all tests in that suite.
0.4.8
TestFailureimplementsExceptionfor compatibility withonly_throw_exceptions.
0.4.7
- Remove logging about enabling the chain-stack-traces flag from the invoker.
0.4.6
- 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.
0.4.5
- Add defaulting for older test backends that don't pass a configuration for
the
allow_duplicate_test_namesparameter to the remote listener.
0.4.4
- Allow disabling duplicate test or group names in the
Declarer.
0.4.3
- Use the latest
package:matcher.
0.4.2
- Update
analyzerconstraint to>=1.5.0 <3.0.0.
0.4.1
- Give a better error when
printOnFailureis called from outside a test zone.
0.4.0
- 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.
0.3.0
- Breaking
TestException.messageis now nullable.- Fixes handling of
nullmessages in remote exceptions.
- Fixes handling of
0.2.20
- Fix some strong null safety mode errors in the original migration.
0.2.19
- Stable release for null safety.
0.2.19-nullsafety.7
- Expand upper bound constraints for some null safe migrated packages.
0.2.19-nullsafety.6
- Fix
spawnHybridUrito respect language versioning of the spawned uri.
0.2.19-nullsafety.5
- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
0.2.19-nullsafety.4
- Allow prerelease versions of the 2.12 sdk.
0.2.19-nullsafety.3
- Add capability to filter to a single exact test name in
Declarer. - Add
markTestSkippedAPI.
0.2.19-nullsafety.2
- Allow
2.10stable and2.11.0-devSDKs. - Annotate the classes used as annotations to restrict their usage to library level.
0.2.19-nullsafety
- 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).
0.2.18+1 (Backport)
- Fix
spawnHybridUrito respect language versioning of the spawned uri.
0.2.18
- Update to
matcherversion0.12.9.
0.2.17
- Add
languageVersionCommenton theMetaDataclass. This should only be present for test suites.
0.2.16
- Deprecate
LiveTestController.liveTest, theLiveTestControllerinstance now implementsLiveTestand can be used directly.
0.2.15
- 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.
0.2.14
- Bump minimum SDK to
2.4.0for safer usage of for-loop elements.
0.2.13
- Work around a bug in the
2.3.0SDK by avoiding for-loop elements at the top level.
0.2.12
- Link to docs on setting timeout when a test times out with the default duration.
- No longer directly depend on
package:pedantic.
0.2.11
- Extend the timeout for synthetic tests, e.g.
tearDownAll.
0.2.10
- Update to latest
package:matcher. Improves output for instances of private classes.
0.2.9
- Treat non-solo tests as skipped so they are properly reported.
0.2.8
- 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.
0.2.7
- Prepare for upcoming
Stream<List<int>>changes in the Dart SDK. - Mark
package:test_apias deprecated to prevent accidental use.
0.2.6
- Don't swallow exceptions from callbacks in
expectAsync*. - Internal cleanup - fix lints.
- Fixed a race condition that caused tests to occasionally fail during
tearDownAllwith the message(tearDownAll) - did not complete [E].
0.2.5
- Expose the
Metadata,PlatformSelector,Runtime, andSuitePlatformclasses publicly through a newbackend.dartimport.
0.2.4
- Allow
stream_channelversion2.0.0.
0.2.3
- Update to matcher version
0.12.5.
0.2.2
- Require Dart SDK
>=2.1.0.
0.2.1
- Add
remote_listener.dartandsuite_channel_manager.dart.
0.2.0
- Remove "runner" extensions.
0.1.1
- Update
stack_trace_formatterto foldtest_apiframes by default.
0.1.0
- Initial release of
test_api. Provides the basic API for writing tests and touch points for implementing a custom test runner.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add test_apipubspec.yaml
name: test_api
version: 0.4.17
description: >-
The user facing API for structuring Dart tests and checking expectations.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api
environment:
sdk: ">=2.18.0 <3.0.0"
dependencies:
async: ^2.5.0
boolean_selector: ^2.1.0
collection: ^1.15.0
meta: ^1.3.0
source_span: ^1.8.0
stack_trace: ^1.10.0
stream_channel: ^2.1.0
string_scanner: ^1.1.0
term_glyph: ^1.2.0
# Use a tight version constraint to ensure that a constraint on matcher
# properly constrains all features it provides.
matcher: '>=0.12.11 <0.12.15'
dev_dependencies:
analyzer: '>=2.1.0 <6.0.0'
fake_async: ^1.2.0
glob: ^2.0.0
graphs: ^2.0.0
path: ^1.8.0
lints: '>=1.0.0 <3.0.0'
test: any
test_core: any
dependency_overrides:
test:
path: ../test
test_core:
path: ../test_core
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.1.0 | 2018-10-26T22:24:03.553975Z | Download | a549af8311ace4468b5afc2ffbbec413fd0d264a6d2c6e9f38fc9fc80456f2fc |
| 0.1.1 | 2018-10-30T22:34:25.464813Z | Download | fba8397fdd7aba2c45a865438e60a4249b03b8faf70054b0fecc7019e44ce642 |
| 0.2.0 | 2018-11-01T20:31:42.460468Z | Download | 6a521ba863204b5850186419c2f37f11f0b953496e069f5108992f5088fdc25a |
| 0.2.1 | 2018-11-05T18:26:46.370358Z | Download | a8a5314c71f301cc6e4a316a504dc64c88838b528eca0b8dc947ee4f5f50adb3 |
| 0.2.2 | 2019-01-18T01:32:24.313427Z | Download | 2da2b174f7d01573a2b954630eb6e5dac0b226abe478487df55993b44887dd92 |
| 0.2.3 | 2019-03-25T22:58:11.095519Z | Download | 0a6811689a8529a58f6045663dce4c1cab4a031bbcaa9b4094ad6a1d4bd32999 |
| 0.2.4 | 2019-03-27T21:41:15.971713Z | Download | 1b2bf26516900e5def597e2d30dfe81f905b17a95df090470e5e8e9d75225e03 |
| 0.2.5 | 2019-04-09T18:12:29.376701Z | Download | 5677535f17249244bcaea38e81367bb526485f647451574398c26a3bf8856ae3 |
| 0.2.6 | 2019-06-03T18:10:21.815528Z | Download | 1f4125b5e0887a41794f4905e714ae7d28fdb55a6394972d5965fcbfad4c397e |
| 0.2.7 | 2019-08-21T22:12:16.556850Z | Download | 105b02878a7dfda58a5244fb3b1b9b6e989280d6e9029c76355c249b81e53182 |
| 0.2.8 | 2019-09-23T19:27:29.310963Z | Download | 1a74c885efd8ca81ddd27f494fbaaae5cf57695792335f29337c146acb099bed |
| 0.2.9 | 2019-10-16T19:42:42.884786Z | Download | 94f67b6d245ece8d42cefe831b9da3b0dd8361304fb59823887fd349137e96d8 |
| 0.2.10 | 2019-10-23T22:01:06.317182Z | Download | 6177bb90cf528a50f4bc376a7bb18e5345a5fde2daa72bf6b34b731800569456 |
| 0.2.11 | 2019-11-07T21:37:42.364934Z | Download | b1906786a32c9a62ba304f730288e488401f7de34a83ae6cc476d0175795e6c6 |
| 0.2.12 | 2020-01-08T18:13:50.560164Z | Download | 61e30c679190f511ddfdc0dd6775b44fae70e906349fc3617c633e0cd2677737 |
| 0.2.13 | 2020-01-19T18:09:18.832039Z | Download | cb0c86b243373facc6b6d381e293b347336d3984a4892dcf6f9d214b1b77bbf3 |
| 0.2.14 | 2020-02-04T20:27:32.906644Z | Download | f6a548d4752796119643f8a897b8bcd7c37c648657726fcaa7a988d73a316c1a |
| 0.2.15 | 2020-03-02T20:45:44.100929Z | Download | d10765ccf2a894f20136610d47d1b1ebd0e22bcd26712c5bf2654b335ab0d119 |
| 0.2.16 | 2020-05-22T02:51:17.564670Z | Download | 535ed92e6107e1d1d5f408fa0d6e71d64965992fdaafdb8a4313009dd0c9c7d7 |
| 0.2.17 | 2020-06-17T20:55:37.747628Z | Download | 14514d47cbda61a2be7b40d587d10de368f83851dc1b41493e63a2c45a40fc79 |
| 0.2.18 | 2020-07-15T18:22:13.726178Z | Download | d2fad3b521a289b2eb3b776fb47ba1603ecf026ddcfd1feaa5660235ce50e4c9 |
| 0.2.18+1 | 2020-11-11T20:31:35.606123Z | Download | 4ed501297433c3a7c02dfcbdcba959f3cc14b0dc5d3416e4986e78bb2f65c72c |
| 0.2.19-nullsafety | 2020-07-29T16:04:27.246636Z | Download | 40b340fc31a6dd274787ef59a1d2d413271f189cf4d7422e86c77a055de7bc2a |
| 0.2.19-nullsafety.2 | 2020-09-22T16:26:45.062303Z | Download | 60d3351e804e359157964a497f7d23aa1c4fcd43334fc7818da983ee971c6424 |
| 0.2.19-nullsafety.3 | 2020-10-21T21:21:12.143658Z | Download | 3166cca799839ae66cc593ab48471d40fb1e8fed5054985dcb0175070a137600 |
| 0.2.19-nullsafety.4 | 2020-10-23T20:23:46.239707Z | Download | e0eff346ddf67a79a1e3fc9e8d6d9a209eadb236ab78929be310ab066d7e0276 |
| 0.2.19-nullsafety.5 | 2020-11-03T22:37:53.606761Z | Download | dab7a6d6707198991ed9e2bef04dc4e6712e685cc6f3897d7fdd62cc398416c7 |
| 0.2.19-nullsafety.6 | 2020-11-05T02:05:06.898981Z | Download | ae00bfc935727367d9920b61fb926f0ce607c14b32b6f5aa379d80026808d7da |
| 0.2.19-nullsafety.7 | 2021-02-02T19:10:26.496586Z | Download | 0ab76d59126dd1f6f4734197377d7c6e5c076508dd351f5c65aa107caf29a74d |
| 0.2.19 | 2021-02-03T03:21:07.499546Z | Download | 637a0c7ff81307fe6e31edfd338c798aeeef4c2c3fad031fc91ec92d5ef47c75 |
| 0.2.20 | 2021-03-08T21:26:56.755907Z | Download | 5a04dca0b22817baca1530ba2b192727d9199db1bb6a0f44e47ce17e3090d328 |
| 0.3.0 | 2021-03-09T19:00:44.608205Z | Download | 9ddd24ec429417cfffd744115508a95f0ee956ec02a2d972dd7fbfbfe047cf45 |
| 0.4.0 | 2021-04-21T22:49:19.994740Z | Download | f27b321e23d18b58891d880ed565be7f517cd9dcce2652873101a7c742a9c8ca |
| 0.4.1 | 2021-06-09T20:01:50.231657Z | Download | da32817755583ef40031986541cdde293c0f1ccd1a7d97811b7335ae265f7742 |
| 0.4.2 | 2021-07-13T01:45:17.447732Z | Download | 299f2348a0106882f5f107541b0dbd491aa45b4bbdd008abe10b387a45b9afba |
| 0.4.3 | 2021-08-16T19:08:26.559740Z | Download | 3c3c3eb64242eec8aeb7a7e530cd541737a84bb01fc08b363b429aaa4a91060d |
| 0.4.4 | 2021-09-30T16:22:53.740709Z | Download | b15245318fa0527f8528c24637192ef2dd0d6e83572143304826046f571158ac |
| 0.4.5 | 2021-10-01T18:08:00.148909Z | Download | 1d85ff8cf1c50e25fab2ff8164a5858a6007ec6215a3518b837156cc03ae83b9 |
| 0.4.6 | 2021-10-20T18:34:41.343421Z | Download | 82c0788c444425d9f741b752b6ffc7c648a73f7d5cfc280c649b483c60f4d0fd |
| 0.4.7 | 2021-11-02T17:47:10.407425Z | Download | 053996f38c9c80a64967d5299c83836c06a1f8a33780b4897b1b376f5d26519d |
| 0.4.8 | 2021-11-24T16:51:20.333721Z | Download | 52dacee6e6db8d0cefa8c01874eeb5863a5aea4bda7372513cb77b25d8d9b1fa |
| 0.4.9 | 2021-12-16T18:02:49.091458Z | Download | d8ca35bbbeef2d037e5693a3c8a381505afebfbfee7bc33fff5581bc4e16a939 |
| 0.4.10 | 2022-06-15T19:48:19.881727Z | Download | dfe56c0cfe57dc3cc97c38b6e5fe4bd9120a74f4d0bce4b384db489738208699 |
| 0.4.11 | 2022-06-22T17:48:16.657654Z | Download | 9c8f99467e5221539f489b5774d6c1a1744637ddd88a1b56ee4349b87004a5ce |
| 0.4.12 | 2022-07-06T18:34:12.426429Z | Download | b882da9bdac8e6a846796a411b13c233cd5dfd03713888225e551cf27632acdb |
| 0.4.13 | 2022-08-19T23:10:14.489689Z | Download | b3d8b74cfb0d09438b35d0906c9acd049c5fb631bde55446e90153bf983e223d |
| 0.4.14 | 2022-09-12T21:26:22.591432Z | Download | ceeddf59d613e862e77f4b506cfc2945ac9637ce0b4c00f4f4c1ac639f3e9731 |
| 0.4.15 | 2022-10-26T22:34:19.713166Z | Download | c9aba3b3dbfe8878845dfab5fa096eb8de7b62231baeeb1cea8e3ee81ca8c6d8 |
| 0.4.16 | 2022-11-01T17:54:45.476727Z | Download | ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 |
| 0.4.17 | 2022-12-08T22:53:12.386649Z | Download | c9282698e2982b6c3817037554e52f99d4daba493e8028f8112a83d68ccd0b12 |
| 0.4.18 | 2023-01-11T23:23:34.982414Z | Download | 6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d |
| 0.5.0 | 2023-03-23T18:42:17.773720Z | Download | 6b12a91cd2febdb6f7e7d92c00d1d0c01d88bffc7fe36b1ed236f0cc37cb5ca4 |
| 0.5.1 | 2023-03-31T17:09:41.162790Z | Download | eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb |
| 0.5.2 | 2023-04-19T01:30:21.495464Z | Download | daadc9baabec998b062c9091525aa95786508b1c48e9c30f1f891b8bf6ff2e64 |
| 0.6.0 | 2023-05-16T22:48:05.669989Z | Download | 75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8 |
| 0.6.1 | 2023-06-28T19:47:26.392381Z | Download | 5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b |
| 0.7.0 | 2023-12-13T18:47:25.450208Z | Download | 9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f |
| 0.7.1 | 2024-04-08T23:16:53.823562Z | Download | 2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794 |
| 0.7.2 | 2024-06-02T17:02:55.441804Z | Download | 5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb |
| 0.7.3 | 2024-07-03T18:39:51.917194Z | Download | 664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c |
| 0.7.4 | 2024-11-26T16:49:10.007871Z | Download | fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd |
| 0.7.5 | 2025-05-12T19:41:16.648485Z | Download | 6c7653816b1c938e121b69ff63a33c9dc68102b65a5fb0a5c0f9786256ed33e6 |
| 0.7.6 | 2025-05-19T15:16:50.670137Z | Download | 522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00 |
| 0.7.7 | 2025-07-21T23:24:11.239477Z | Download | ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 |
| 0.7.8 | 2025-11-11T01:15:20.585901Z | Download | 19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8 |
| 0.7.9 | 2026-01-07T23:08:06.438135Z | Download | 93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636 |
| 0.7.10 | 2026-02-27T01:53:07.313797Z | Download | 8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a |
| 0.7.11 | 2026-03-18T23:28:11.380797Z | Download | 949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e |
| 0.7.12 | 2026-04-27T20:39:09.666469Z | Download | 2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11 |
| 0.7.13 | 2026-06-27T01:31:46.652136Z | Download | 475610b2aa23c19687cce2961e44b0cc57cafe220f67c2b80201231b2a07fbe7 |
| 0.7.14 | 2026-09-02T23:46:39.833851Z | Download | 0a10344e901e5b2e63819567951cb6a06673ed6b84f40462188ff5a0c41f371f |
| 0.7.15 | 2026-10-08T19:04:21.681120Z | Download | 47481c58bb92d0b1d218f0510ff5647e768f8e1256d07077a151fb520923b51d |
Dependencies
async "^2.5.0"
boolean_selector "^2.1.0"
collection "^1.15.0"
matcher "\u003e=0.12.11 \u003c0.12.15"
meta "^1.3.0"
source_span "^1.8.0"
stack_trace "^1.10.0"
stream_channel "^2.1.0"
string_scanner "^1.1.0"
term_glyph "^1.2.0"