Skip to content

Commit 9156f10

Browse files
committed
fix: lock issue in Windows
1 parent bec135a commit 9156f10

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/src/commands/dart/commands/dart_test_test.dart

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

142145
Directory.current = tempDirectory.path;
143146
final result = await commandRunner.run(['dart', 'test']);
@@ -152,7 +155,10 @@ void main() {
152155
'completes normally when no pubspec.yaml exists (recursive)',
153156
withRunner((commandRunner, logger, pubUpdater, printLogs) async {
154157
final tempDirectory = Directory.systemTemp.createTempSync();
155-
addTearDown(() => tempDirectory.deleteSync(recursive: true));
158+
addTearDown(() {
159+
Directory.current = cwd;
160+
tempDirectory.deleteSync(recursive: true);
161+
});
156162

157163
Directory.current = tempDirectory.path;
158164

0 commit comments

Comments
 (0)