Skip to content

Commit

Permalink
Point README links to the test library (#2219)
Browse files Browse the repository at this point in the history
Closes #2218

These links were to the defining library, which can change without a
user visible breaking change or major version bump. Link instead to the
`package:test/test.dart` library docs for all APIs. The export makes the
dartdoc links work, and these are more stable since they are user facing
and will only change in a major version release.
  • Loading branch information
natebosch committed May 7, 2024
1 parent d1e2767 commit b7fa27d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.25.6-wip

* Point API doc links to `package:test` canonical libraries.

## 1.25.5

* Update the `package:web_socket_channel` version constraint to allow `3.x`.
Expand Down
14 changes: 7 additions & 7 deletions pkgs/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Tests are specified using the top-level [`test()`] function.
Test asserts can be made using [`expect` from `package:matcher`][expect]

[`test()`]: https://pub.dev/documentation/test_core/latest/test_core.scaffolding/test.html
[`test()`]: https://pub.dev/documentation/test/latest/test/test.html

[expect]: https://pub.dev/documentation/matcher/latest/expect/expect.html

Expand All @@ -60,7 +60,7 @@ void main() {
Tests can be grouped together using the [`group()`] function. Each group's
description is added to the beginning of its test's descriptions.

[`group()`]: https://pub.dev/documentation/test_core/latest/test_core.scaffolding/group.html
[`group()`]: https://pub.dev/documentation/test/latest/test/group.html

```dart
import 'package:test/test.dart';
Expand Down Expand Up @@ -116,9 +116,9 @@ void main() {
}
```

[`setUp()`]: https://pub.dev/documentation/test_core/latest/test_core.scaffolding/setUp.html
[`setUp()`]: https://pub.dev/documentation/test/latest/test/setUp.html

[`tearDown()`]: https://pub.dev/documentation/test_core/latest/test_core.scaffolding/tearDown.html
[`tearDown()`]: https://pub.dev/documentation/test/latest/test/tearDown.html

## Running Tests

Expand Down Expand Up @@ -317,7 +317,7 @@ void main() {
}
```

[`@TestOn`]: https://pub.dev/documentation/test_api/latest/test_api.scaffolding/TestOn-class.html
[`@TestOn`]: https://pub.dev/documentation/test/latest/test/TestOn-class.html

The string you pass to `@TestOn` is what's called a "platform selector", and it
specifies exactly which platforms a test can run on. It can be as simple as the
Expand Down Expand Up @@ -776,9 +776,9 @@ The only difference is where the code from the isolate comes from:
`spawnHybridUri()` takes a URL. They both return a [`StreamChannel`] that
communicates with the hybrid isolate. For example:

[`spawnHybridCode()`]: https://pub.dev/documentation/test_api/latest/test_api.scaffolding/spawnHybridCode.html
[`spawnHybridCode()`]: https://pub.dev/documentation/test/latest/test/spawnHybridCode.html

[`spawnHybridUri()`]: https://pub.dev/documentation/test_api/latest/test_api.scaffolding/spawnHybridUri.html
[`spawnHybridUri()`]: https://pub.dev/documentation/test/latest/test/spawnHybridUri.html

[dart:isolate]: https://api.dart.dev/stable/dart-isolate/dart-isolate-library.html

Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ thought of as frontend functions as well.

The frontend communicates with the backend using zone-scoped getters.
[`Invoker.current`][Invoker] provides access to the current test case to
built-in matchers like [`completion()`][completion], for example to control when
matchers like [`completion()`][completion], for example to control when
it completes. Structural functions use [`Declarer.current`][Declarer] to
gradually build up an in-memory representation of a test suite. The runner is in
charge of setting up these variables, but the frontend never communicates with
the runner directly.

[Invoker]: https://github.com/dart-lang/test/blob/master/lib/src/backend/invoker.dart
[completion]: https://pub.dev/documentation/test_api/latest/test_api/completion.html
[completion]: https://pub.dev/documentation/matcher/latest/expect/completion.html
[Declarer]: https://github.com/dart-lang/test/blob/master/lib/src/backend/declarer.dart

### Backend
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ This field controls whether or not tests are skipped. It's usually applied to
`skip` parameter for [`test()`][test], it can either be a boolean indicating
whether the tests are skipped or a string indicating the reason they're skipped.

[test]: https://pub.dev/documentation/test_api/latest/test_api/test.html
[test]: https://pub.dev/documentation/test/latest/test/test.html

```yaml
tags:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.25.5
version: 1.25.6-wip
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand Down

0 comments on commit b7fa27d

Please sign in to comment.