tests - reduce output of integration tests (#84283)

This commit is contained in:
Benjamin Pasero
2020-01-15 12:56:15 +01:00
parent a3a53d730c
commit 2585092dbe
10 changed files with 87 additions and 53 deletions

View File

@@ -70,3 +70,16 @@ function isTestTypeActive(): boolean {
export function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export function withLogDisabled(runnable: () => Promise<any>): () => Promise<void> {
return async (): Promise<void> => {
const logLevel = await vscode.commands.executeCommand('_extensionTests.getLogLevel');
await vscode.commands.executeCommand('_extensionTests.setLogLevel', 6 /* critical */);
try {
await runnable();
} finally {
await vscode.commands.executeCommand('_extensionTests.setLogLevel', logLevel);
}
};
}