Drop pedantic dependency (#1131)
Flutter pins package dependencies, including all transitive dependencies.
Because test_api depends on pedantic, Flutter pins that dependency.
However, pedantic is only depended on for the `unawaited` function, which is a one-line piece of code.
This will enable resolution of https://github.com/flutter/flutter/issues/48246 without requiring Flutter to unpin its dependencies, and with a very small overhead on test_api to not re-import pedantic :) This helps downstream consumers who want to depend on the package for the actual analysis options files.
Also related: https://github.com/dart-lang/pedantic/issues/46
diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md
index 304d5d2..038000f 100644
--- a/pkgs/test/CHANGELOG.md
+++ b/pkgs/test/CHANGELOG.md
@@ -1,7 +1,9 @@
-## 1.10.0-dev
+## 1.10.0
* Add `customHtmlTemplateFile` configuration option to allow sharing an
html template between tests
+* Depend on the latest `package:test_core`.
+* Depend on the latest `package:test_api`.
## 1.9.4
diff --git a/pkgs/test/lib/src/runner/browser/browser.dart b/pkgs/test/lib/src/runner/browser/browser.dart
index 881dd74..fa816db 100644
--- a/pkgs/test/lib/src/runner/browser/browser.dart
+++ b/pkgs/test/lib/src/runner/browser/browser.dart
@@ -6,7 +6,6 @@
import 'dart:convert';
import 'dart:io';
-import 'package:pedantic/pedantic.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:typed_data/typed_data.dart';
diff --git a/pkgs/test/lib/src/runner/browser/firefox.dart b/pkgs/test/lib/src/runner/browser/firefox.dart
index 06a279a..cf0efe6 100644
--- a/pkgs/test/lib/src/runner/browser/firefox.dart
+++ b/pkgs/test/lib/src/runner/browser/firefox.dart
@@ -7,7 +7,6 @@
import 'package:path/path.dart' as p;
import 'package:pedantic/pedantic.dart';
-
import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
diff --git a/pkgs/test/lib/src/runner/browser/phantom_js.dart b/pkgs/test/lib/src/runner/browser/phantom_js.dart
index 2a00ed7..d2adbcd 100644
--- a/pkgs/test/lib/src/runner/browser/phantom_js.dart
+++ b/pkgs/test/lib/src/runner/browser/phantom_js.dart
@@ -7,12 +7,10 @@
import 'package:path/path.dart' as p;
import 'package:pedantic/pedantic.dart';
-
import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports
-
+import 'package:test_core/src/runner/application_exception.dart'; // ignore: implementation_imports
import 'package:test_core/src/util/exit_codes.dart' // ignore: implementation_imports
as exit_codes;
-import 'package:test_core/src/runner/application_exception.dart'; // ignore: implementation_imports
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
import '../executable_settings.dart';
diff --git a/pkgs/test/lib/src/runner/browser/safari.dart b/pkgs/test/lib/src/runner/browser/safari.dart
index 2bd5d80..a47bb09 100644
--- a/pkgs/test/lib/src/runner/browser/safari.dart
+++ b/pkgs/test/lib/src/runner/browser/safari.dart
@@ -8,13 +8,12 @@
import 'package:path/path.dart' as p;
import 'package:pedantic/pedantic.dart';
-
import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
+import '../executable_settings.dart';
import 'browser.dart';
import 'default_settings.dart';
-import '../executable_settings.dart';
/// A class for running an instance of Safari.
///
diff --git a/pkgs/test/lib/src/runner/node/platform.dart b/pkgs/test/lib/src/runner/node/platform.dart
index c888f93..bc23173 100644
--- a/pkgs/test/lib/src/runner/node/platform.dart
+++ b/pkgs/test/lib/src/runner/node/platform.dart
@@ -9,7 +9,6 @@
import 'package:async/async.dart';
import 'package:multi_server_socket/multi_server_socket.dart';
import 'package:node_preamble/preamble.dart' as preamble;
-import 'package:pedantic/pedantic.dart';
import 'package:package_resolver/package_resolver.dart';
import 'package:path/path.dart' as p;
import 'package:stream_channel/stream_channel.dart';
diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml
index 0177e3e..7a88666 100644
--- a/pkgs/test/pubspec.yaml
+++ b/pkgs/test/pubspec.yaml
@@ -31,8 +31,8 @@
web_socket_channel: ^1.0.0
yaml: ^2.0.0
# Use an exact version until the test_api and test_core package are stable.
- test_api: 0.2.11
- test_core: 0.2.15
+ test_api: 0.2.12
+ test_core: 0.2.16
dev_dependencies:
fake_async: ^1.0.0
diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md
index 6a6c88f..070b9cd 100644
--- a/pkgs/test_api/CHANGELOG.md
+++ b/pkgs/test_api/CHANGELOG.md
@@ -1,7 +1,8 @@
-## 0.2.12-dev
+## 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
diff --git a/pkgs/test_api/lib/src/backend/invoker.dart b/pkgs/test_api/lib/src/backend/invoker.dart
index 08009b1..f009645 100644
--- a/pkgs/test_api/lib/src/backend/invoker.dart
+++ b/pkgs/test_api/lib/src/backend/invoker.dart
@@ -4,7 +4,6 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
import 'package:stack_trace/stack_trace.dart';
import '../frontend/expect.dart';
diff --git a/pkgs/test_api/lib/src/frontend/stream_matcher.dart b/pkgs/test_api/lib/src/frontend/stream_matcher.dart
index 7ba7f55..35b150e 100644
--- a/pkgs/test_api/lib/src/frontend/stream_matcher.dart
+++ b/pkgs/test_api/lib/src/frontend/stream_matcher.dart
@@ -6,7 +6,6 @@
import 'package:async/async.dart';
import 'package:matcher/matcher.dart';
-import 'package:pedantic/pedantic.dart';
import '../utils.dart';
import 'async_matcher.dart';
diff --git a/pkgs/test_api/lib/src/utils.dart b/pkgs/test_api/lib/src/utils.dart
index 7229543..7f9be33 100644
--- a/pkgs/test_api/lib/src/utils.dart
+++ b/pkgs/test_api/lib/src/utils.dart
@@ -323,3 +323,12 @@
/// we can use it through StringDescription.
String prettyPrint(value) =>
StringDescription().addDescriptionOf(value).toString();
+
+/// Indicates to tools that [future] is intentionally not `await`-ed.
+///
+/// In an `async` context, it is normally expected that all [Future]s are
+/// awaited, and that is the basis of the lint `unawaited_futures`. However,
+/// there are times where one or more futures are intentionally not awaited.
+/// This function may be used to ignore a particular future. It silences the
+/// `unawaited_futures` lint.
+void unawaited(Future<void> future) {}
diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml
index 3abd444..8027988 100644
--- a/pkgs/test_api/pubspec.yaml
+++ b/pkgs/test_api/pubspec.yaml
@@ -1,5 +1,5 @@
name: test_api
-version: 0.2.12-dev
+version: 0.2.12
author: Dart Team <misc@dartlang.org>
description: A library for writing Dart tests.
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_api
@@ -13,7 +13,6 @@
collection: ^1.8.0
meta: ^1.1.5
path: ^1.2.0
- pedantic: ^1.0.0
source_span: ^1.4.0
stack_trace: ^1.9.0
stream_channel: ">=1.7.0 <3.0.0"
@@ -26,6 +25,7 @@
dev_dependencies:
fake_async: ^1.0.0
+ pedantic: ^1.0.0
test_descriptor: ^1.0.0
test_process: ^1.0.0
test: any
diff --git a/pkgs/test_api/test/backend/invoker_test.dart b/pkgs/test_api/test/backend/invoker_test.dart
index 9eef1fd..28ab7bd 100644
--- a/pkgs/test_api/test/backend/invoker_test.dart
+++ b/pkgs/test_api/test/backend/invoker_test.dart
@@ -5,7 +5,6 @@
import 'dart:async';
import 'package:fake_async/fake_async.dart';
-import 'package:pedantic/pedantic.dart';
import 'package:test/test.dart';
import 'package:test_api/src/backend/group.dart';
import 'package:test_api/src/backend/invoker.dart';
@@ -14,6 +13,7 @@
import 'package:test_api/src/backend/metadata.dart';
import 'package:test_api/src/backend/state.dart';
import 'package:test_api/src/backend/suite.dart';
+import 'package:test_api/src/utils.dart';
import '../utils.dart';
diff --git a/pkgs/test_api/test/frontend/add_tear_down_test.dart b/pkgs/test_api/test/frontend/add_tear_down_test.dart
index 10c3f93..1027491 100644
--- a/pkgs/test_api/test/frontend/add_tear_down_test.dart
+++ b/pkgs/test_api/test/frontend/add_tear_down_test.dart
@@ -5,7 +5,7 @@
import 'dart:async';
import 'package:async/async.dart';
-import 'package:pedantic/pedantic.dart';
+import 'package:test_api/src/utils.dart';
import 'package:test/test.dart';
import '../utils.dart';
diff --git a/pkgs/test_api/test/frontend/matcher/completion_test.dart b/pkgs/test_api/test/frontend/matcher/completion_test.dart
index 59f7729..87c8f69 100644
--- a/pkgs/test_api/test/frontend/matcher/completion_test.dart
+++ b/pkgs/test_api/test/frontend/matcher/completion_test.dart
@@ -4,9 +4,9 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
import 'package:test/test.dart';
import 'package:test_api/src/backend/state.dart';
+import 'package:test_api/src/utils.dart';
import '../../utils.dart';
diff --git a/pkgs/test_api/test/frontend/matcher/prints_test.dart b/pkgs/test_api/test/frontend/matcher/prints_test.dart
index 4cc5ba1..5516fd9 100644
--- a/pkgs/test_api/test/frontend/matcher/prints_test.dart
+++ b/pkgs/test_api/test/frontend/matcher/prints_test.dart
@@ -4,7 +4,7 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
+import 'package:test_api/src/utils.dart';
import 'package:test/test.dart';
import '../../utils.dart';
diff --git a/pkgs/test_api/test/frontend/matcher/throws_test.dart b/pkgs/test_api/test/frontend/matcher/throws_test.dart
index 1d589a2..ed9cc01 100644
--- a/pkgs/test_api/test/frontend/matcher/throws_test.dart
+++ b/pkgs/test_api/test/frontend/matcher/throws_test.dart
@@ -4,7 +4,7 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
+import 'package:test_api/src/utils.dart';
import 'package:test/test.dart';
import '../../utils.dart';
diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md
index fbe9a65..fbd1e2d 100644
--- a/pkgs/test_core/CHANGELOG.md
+++ b/pkgs/test_core/CHANGELOG.md
@@ -1,8 +1,9 @@
-## 0.2.16-dev
+## 0.2.16
* Internal cleanup.
* Add `customHtmlTemplateFile` configuration option to allow sharing an
html template between tests
+* Depend on the latest `test_api`.
## 0.2.15
diff --git a/pkgs/test_core/lib/src/runner/load_suite.dart b/pkgs/test_core/lib/src/runner/load_suite.dart
index 04dd122..a8d2825 100644
--- a/pkgs/test_core/lib/src/runner/load_suite.dart
+++ b/pkgs/test_core/lib/src/runner/load_suite.dart
@@ -4,7 +4,6 @@
import 'dart:async';
-import 'package:pedantic/pedantic.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:stream_channel/stream_channel.dart';
diff --git a/pkgs/test_core/lib/src/runner/runner_test.dart b/pkgs/test_core/lib/src/runner/runner_test.dart
index e80f849..44fb3a7 100644
--- a/pkgs/test_core/lib/src/runner/runner_test.dart
+++ b/pkgs/test_core/lib/src/runner/runner_test.dart
@@ -5,7 +5,6 @@
import 'package:pedantic/pedantic.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:stream_channel/stream_channel.dart';
-
import 'package:test_api/src/backend/group.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/live_test.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/live_test_controller.dart'; // ignore: implementation_imports
diff --git a/pkgs/test_core/lib/test_core.dart b/pkgs/test_core/lib/test_core.dart
index b7cdae9..7b44b0f 100644
--- a/pkgs/test_core/lib/test_core.dart
+++ b/pkgs/test_core/lib/test_core.dart
@@ -10,7 +10,6 @@
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;
-import 'package:pedantic/pedantic.dart';
import 'package:test_api/backend.dart'; //ignore: deprecated_member_use
import 'package:test_api/src/backend/declarer.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/invoker.dart'; // ignore: implementation_imports
diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml
index da52876..1ca8e87 100644
--- a/pkgs/test_core/pubspec.yaml
+++ b/pkgs/test_core/pubspec.yaml
@@ -1,5 +1,5 @@
name: test_core
-version: 0.2.16-dev
+version: 0.2.16
author: Dart Team <misc@dartlang.org>
description: A basic library for writing tests and running them on the VM.
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_core
@@ -32,7 +32,7 @@
# properly constrains all features it provides.
matcher: ">=0.12.6 <0.12.7"
# Use an exact version until the test_api package is stable.
- test_api: 0.2.11
+ test_api: 0.2.12
dependency_overrides:
test_api: