[flutter_tools] allow using flutter test for testing the tool too (#69911)
This commit is contained in:
@@ -188,6 +188,8 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
@override List<String> extraFrontEndOptions,
|
||||
bool nullAssertions = false,
|
||||
BuildInfo buildInfo,
|
||||
String reporter,
|
||||
String timeout,
|
||||
}) async {
|
||||
lastEnableObservatoryValue = enableObservatory;
|
||||
return exitCode;
|
||||
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
fileSystem.file('test/foo.dart').createSync(recursive: true);
|
||||
fileSystem.file('.packages')
|
||||
..createSync()
|
||||
..writeAsStringSync('flutter_test:flutter_test/');
|
||||
..writeAsStringSync('test_api:test_api/\n');
|
||||
residentCompiler = MockResidentCompiler();
|
||||
});
|
||||
|
||||
@@ -109,7 +109,7 @@ void main() {
|
||||
Logger: () => BufferLogger.test(),
|
||||
});
|
||||
|
||||
testUsingContext('TestCompiler reports an error when there is no dependency on flutter_test', () async {
|
||||
testUsingContext('TestCompiler reports an error when there is no dependency on flutter_test or test', () async {
|
||||
final FakeTestCompiler testCompiler = FakeTestCompiler(
|
||||
BuildInfo.debug,
|
||||
FlutterProject.current(),
|
||||
@@ -118,7 +118,8 @@ void main() {
|
||||
fileSystem.file('.packages').writeAsStringSync('\n');
|
||||
|
||||
expect(await testCompiler.compile(Uri.parse('test/foo.dart')), null);
|
||||
expect(testLogger.errorText, contains('Error: cannot run without a dependency on "package:flutter_test"'));
|
||||
expect(testLogger.errorText, contains('Error: cannot run without a dependency on '
|
||||
'either "package:flutter_test" or "package:test'));
|
||||
verifyNever(residentCompiler.recompile(
|
||||
any,
|
||||
<Uri>[Uri.parse('test/foo.dart')],
|
||||
|
||||
Reference in New Issue
Block a user