Skip to content

Commit 5c7d49d

Browse files
committed
Make sure we do not miss folders
1 parent e041c88 commit 5c7d49d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/integration-tests/utilities/testutilities.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,17 @@ const extensionBootstrapper = (() => {
238238
} else if (expectedAssets.length > 0) {
239239
await new Promise<void>(res => {
240240
const found: string[] = [];
241-
workspaceContext.onDidChangeFolders(e => {
241+
for (const f of workspaceContext.folders) {
242+
if (found.includes(f.name) || !expectedAssets.includes(f.name)) {
243+
continue;
244+
}
245+
found.push(f.name);
246+
}
247+
if (expectedAssets.length === found.length) {
248+
res();
249+
return;
250+
}
251+
const disposable = workspaceContext.onDidChangeFolders(e => {
242252
if (
243253
e.operation !== FolderOperation.add ||
244254
found.includes(e.folder!.name) ||
@@ -249,6 +259,7 @@ const extensionBootstrapper = (() => {
249259
found.push(e.folder!.name);
250260
if (expectedAssets.length === found.length) {
251261
res();
262+
disposable.dispose();
252263
}
253264
});
254265
});

0 commit comments

Comments
 (0)