[WIP] allow analyzer 0.40.x in stable test/test_core packages (#1343)

diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md
index 29a16f3..dab1ac9 100644
--- a/pkgs/test/CHANGELOG.md
+++ b/pkgs/test/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.15.4
+
+* Allow analyzer 0.40.x.
+
 ## 1.15.3
 
 * Update to `matcher` version `0.12.9` which improves the mismatch description
diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml
index 3fb0d42..ebacee2 100644
--- a/pkgs/test/pubspec.yaml
+++ b/pkgs/test/pubspec.yaml
@@ -1,5 +1,5 @@
 name: test
-version: 1.15.3
+version: 1.15.4
 description: A full featured library for writing and running Dart tests.
 homepage: https://github.com/dart-lang/test/blob/master/pkgs/test
 
@@ -7,7 +7,7 @@
   sdk: '>=2.7.0 <3.0.0'
 
 dependencies:
-  analyzer: '>=0.36.0 <0.40.0'
+  analyzer: '>=0.36.0 <0.41.0'
   async: ^2.0.0
   boolean_selector: '>=1.0.0 <3.0.0'
   coverage: '>=0.13.4 < 0.15.0'
@@ -33,7 +33,7 @@
   yaml: ^2.0.0
   # Use an exact version until the test_api and test_core package are stable.
   test_api: 0.2.18
-  test_core: 0.3.11
+  test_core: 0.3.11+1
 
 dev_dependencies:
   fake_async: ^1.0.0
diff --git a/pkgs/test/test/runner/runner_test.dart b/pkgs/test/test/runner/runner_test.dart
index 2395991..f1227aa 100644
--- a/pkgs/test/test/runner/runner_test.dart
+++ b/pkgs/test/test/runner/runner_test.dart
@@ -716,7 +716,7 @@
 
     setUp(() async {
       await d.file('opted_in.dart', '''
-// @dart=2.9
+// @dart=2.10
 bool? foo;''').create();
     });
 
@@ -734,7 +734,7 @@
 
     test('sound null safety is enabled if the entrypoint opts in', () async {
       await d.file('test.dart', '''
-// @dart=2.9
+// @dart=2.10
 $_testContents''').create();
       var test = await runTest(['test.dart'],
           packageConfig: (await Isolate.packageConfig).path,
@@ -743,9 +743,9 @@
       expect(
           test.stdout,
           containsInOrder([
-            'Unable to spawn isolate:',
-            'Error: A library can\'t opt out of null safety by default, '
-                'when using sound null safety.'
+            'Unable to spawn isolate: Error: Cannot run with sound null '
+                'safety as one or more dependencies do not',
+            'support null safety:',
           ]));
       await test.shouldExit(1);
     });
@@ -756,7 +756,7 @@
       var newPackageConfig = PackageConfig([
         ...currentPackageConfig.packages,
         Package('example', Uri.file('${d.sandbox}/'),
-            languageVersion: LanguageVersion(2, 9),
+            languageVersion: LanguageVersion(2, 10),
             // TODO: https://github.com/dart-lang/package_config/issues/81
             packageUriRoot: Uri.file('${d.sandbox}/')),
       ]);
@@ -774,9 +774,9 @@
       expect(
           test.stdout,
           containsInOrder([
-            'Unable to spawn isolate:',
-            'Error: A library can\'t opt out of null safety by default, '
-                'when using sound null safety.'
+            'Unable to spawn isolate: Error: Cannot run with sound null '
+                'safety as one or more dependencies do not',
+            'support null safety:',
           ]));
       await test.shouldExit(1);
     });
diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md
index 2258f0a..8c3b03f 100644
--- a/pkgs/test_core/CHANGELOG.md
+++ b/pkgs/test_core/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.3.11+1
+
+* Allow analyzer 0.40.x.
+
 ## 0.3.11
 
 * Update to `matcher` version `0.12.9`.
diff --git a/pkgs/test_core/lib/src/runner/configuration/reporters.dart b/pkgs/test_core/lib/src/runner/configuration/reporters.dart
index 6793b23..94a4ca1 100644
--- a/pkgs/test_core/lib/src/runner/configuration/reporters.dart
+++ b/pkgs/test_core/lib/src/runner/configuration/reporters.dart
@@ -43,8 +43,11 @@
       (_, engine, sink) => JsonReporter.watch(engine, sink)),
 };
 
-final defaultReporter =
-    inTestTests ? 'expanded' : canUseSpecialChars ? 'compact' : 'expanded';
+final defaultReporter = inTestTests
+    ? 'expanded'
+    : canUseSpecialChars
+        ? 'compact'
+        : 'expanded';
 
 /// **Do not call this function without express permission from the test package
 /// authors**.
diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml
index c712729..1375468 100644
--- a/pkgs/test_core/pubspec.yaml
+++ b/pkgs/test_core/pubspec.yaml
@@ -1,5 +1,5 @@
 name: test_core
-version: 0.3.11
+version: 0.3.11+1
 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
 
@@ -7,7 +7,7 @@
   sdk: ">=2.7.0 <3.0.0"
 
 dependencies:
-  analyzer: ">=0.39.5 <0.40.0"
+  analyzer: ">=0.39.5 <0.41.0"
   async: ^2.0.0
   args: ^1.4.0
   boolean_selector: ">=1.0.0 <3.0.0"