diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart index 0c50eecf95..a18b55f1df 100644 --- a/packages/flutter_tools/lib/src/flutter_cache.dart +++ b/packages/flutter_tools/lib/src/flutter_cache.dart @@ -127,7 +127,8 @@ class PubDependencies extends ArtifactSet { project: _projectFactory.fromDirectory( fileSystem.directory(fileSystem.path.join(_flutterRoot(), 'packages', 'flutter_tools')) ), - offline: offline + offline: offline, + outputMode: PubOutputMode.none, ); } } diff --git a/packages/flutter_tools/test/general.shard/cache_test.dart b/packages/flutter_tools/test/general.shard/cache_test.dart index 5d8ac71085..65976c4aeb 100644 --- a/packages/flutter_tools/test/general.shard/cache_test.dart +++ b/packages/flutter_tools/test/general.shard/cache_test.dart @@ -978,6 +978,13 @@ void main() { await pubDependencies.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils()); expect(pub.calledGet, 1); + expect( + pub.invocations.first, + predicate( + (FakePubInvocation invocation) => invocation.outputMode == PubOutputMode.none, + 'Pub invoked with PubOutputMode.none', + ), + ); }); testUsingContext('Check current DevTools version', () async { @@ -1172,8 +1179,17 @@ class FakeVersionedPackageResolver extends Fake implements VersionedPackageResol } } +class FakePubInvocation { + FakePubInvocation({ + required this.outputMode, + }); + + final PubOutputMode outputMode; +} + class FakePub extends Fake implements Pub { - int calledGet = 0; + final List invocations = []; + int get calledGet => invocations.length; @override Future get({ @@ -1188,7 +1204,7 @@ class FakePub extends Fake implements Pub { bool printProgress = true, PubOutputMode outputMode = PubOutputMode.all, }) async { - calledGet += 1; + invocations.add(FakePubInvocation(outputMode: outputMode)); } }