Disallow unnecessary awaits. (#15172)

This commit is contained in:
Christian Gunderman
2025-12-16 21:28:18 -08:00
committed by GitHub
parent 3e9a0a7628
commit 7f2d33458a
38 changed files with 129 additions and 106 deletions
+10 -8
View File
@@ -1424,9 +1424,10 @@ This extension will run the following MCP servers:
],
});
const previousExtensionConfig = extensionManager.loadExtensionConfig(
path.join(userExtensionsDir, 'my-local-extension'),
);
const previousExtensionConfig =
await extensionManager.loadExtensionConfig(
path.join(userExtensionsDir, 'my-local-extension'),
);
mockPromptForSettings.mockResolvedValueOnce('new-setting-value');
// 3. Call installOrUpdateExtension to perform the update.
@@ -1481,9 +1482,10 @@ This extension will run the following MCP servers:
],
});
const previousExtensionConfig = extensionManager.loadExtensionConfig(
path.join(userExtensionsDir, 'my-auto-update-ext'),
);
const previousExtensionConfig =
await extensionManager.loadExtensionConfig(
path.join(userExtensionsDir, 'my-auto-update-ext'),
);
// 3. Attempt to update and assert it fails
await expect(
@@ -1967,7 +1969,7 @@ This extension will run the following MCP servers:
expect(activeExtensions).toHaveLength(0);
await extensionManager.enableExtension('ext1', SettingScope.User);
activeExtensions = await getActiveExtensions();
activeExtensions = getActiveExtensions();
expect(activeExtensions).toHaveLength(1);
expect(activeExtensions[0].name).toBe('ext1');
});
@@ -1984,7 +1986,7 @@ This extension will run the following MCP servers:
expect(activeExtensions).toHaveLength(0);
await extensionManager.enableExtension('ext1', SettingScope.Workspace);
activeExtensions = await getActiveExtensions();
activeExtensions = getActiveExtensions();
expect(activeExtensions).toHaveLength(1);
expect(activeExtensions[0].name).toBe('ext1');
});