Skip to content

Commit 10ac651

Browse files
committed
fix: directory lock issue on test_test.dart
1 parent 9156f10 commit 10ac651

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/src/commands/test/test_test.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ void main() {
139139
'when no pubspec.yaml exists',
140140
withRunner((commandRunner, logger, pubUpdater, printLogs) async {
141141
final tempDirectory = Directory.systemTemp.createTempSync();
142-
addTearDown(() => tempDirectory.deleteSync(recursive: true));
142+
addTearDown(() {
143+
Directory.current = cwd;
144+
tempDirectory.deleteSync(recursive: true);
145+
});
143146

144147
Directory.current = tempDirectory.path;
145148
final result = await commandRunner.run(['test']);
@@ -154,7 +157,10 @@ void main() {
154157
'completes normally when no pubspec.yaml exists (recursive)',
155158
withRunner((commandRunner, logger, pubUpdater, printLogs) async {
156159
final tempDirectory = Directory.systemTemp.createTempSync();
157-
addTearDown(() => tempDirectory.deleteSync(recursive: true));
160+
addTearDown(() {
161+
Directory.current = cwd;
162+
tempDirectory.deleteSync(recursive: true);
163+
});
158164

159165
Directory.current = tempDirectory.path;
160166

0 commit comments

Comments
 (0)