notebook tests - run verbose (#165149) (#167212)

* notebook tests - run verbose (#165149)

* bumpb

* 💄
This commit is contained in:
Benjamin Pasero
2022-11-26 20:37:52 +01:00
committed by GitHub
parent fd8c9037af
commit ac084d723b
2 changed files with 13 additions and 5 deletions

View File

@@ -66,10 +66,10 @@ export function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export function withLogDisabled(runnable: () => Promise<any>): () => Promise<void> {
function withLogLevel(level: string, runnable: () => Promise<any>): () => Promise<void> {
return async (): Promise<void> => {
const logLevel = await vscode.commands.executeCommand('_extensionTests.getLogLevel');
await vscode.commands.executeCommand('_extensionTests.setLogLevel', 'off');
await vscode.commands.executeCommand('_extensionTests.setLogLevel', level);
try {
await runnable();
@@ -79,6 +79,14 @@ export function withLogDisabled(runnable: () => Promise<any>): () => Promise<voi
};
}
export function withLogDisabled(runnable: () => Promise<any>): () => Promise<void> {
return withLogLevel('off', runnable);
}
export function withVerboseLogs(runnable: () => Promise<any>): () => Promise<void> {
return withLogLevel('trace', runnable);
}
export function assertNoRpc() {
assertNoRpcFromEntry([vscode, 'vscode']);
}