Fix state in test (#48269)

This commit is contained in:
Dan Field 2020-01-06 16:33:31 -08:00 committed by GitHub
parent 79c4c38cc9
commit d73b3682c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,7 +165,11 @@ void main() {
});
group('getRepoPackages', () {
String oldFlutterRoot;
setUp(() {
oldFlutterRoot = Cache.flutterRoot;
Cache.flutterRoot = _kFlutterRoot;
fs.directory(fs.path.join(_kFlutterRoot, 'examples'))
.createSync(recursive: true);
fs.directory(fs.path.join(_kFlutterRoot, 'packages'))
@ -179,6 +183,10 @@ void main() {
.createSync();
});
tearDown(() {
Cache.flutterRoot = oldFlutterRoot;
});
testUsingContext('', () {
final List<String> packagePaths = runner.getRepoPackages()
.map((Directory d) => d.path).toList();