Commit b43378e 1 parent d0e44be commit b43378e Copy full SHA for b43378e
File tree 2 files changed +13
-5
lines changed
extensions/vscode-api-tests/src
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import * as assert from 'assert';
7
7
import * as vscode from 'vscode' ;
8
8
import * as utils from '../utils' ;
9
9
10
- ( vscode . env . uiKind === vscode . UIKind . Web ? suite . skip : suite . skip ) ( 'Notebook Editor' , function ( ) {
10
+ ( vscode . env . uiKind === vscode . UIKind . Web ? suite . skip : suite ) ( 'Notebook Editor' , function ( ) {
11
11
12
12
const contentSerializer = new class implements vscode . NotebookSerializer {
13
13
deserializeNotebook ( ) {
@@ -66,14 +66,14 @@ import * as utils from '../utils';
66
66
} ) ;
67
67
68
68
// #138683
69
- test ( 'Opening a notebook should fire activeNotebook event changed only once' , async function ( ) {
69
+ test ( 'Opening a notebook should fire activeNotebook event changed only once' , utils . withVerboseLogs ( async function ( ) {
70
70
const openedEditor = onDidOpenNotebookEditor ( ) ;
71
71
const resource = await utils . createRandomFile ( undefined , undefined , '.nbdtest' ) ;
72
72
const document = await vscode . workspace . openNotebookDocument ( resource ) ;
73
73
const editor = await vscode . window . showNotebookDocument ( document ) ;
74
74
assert . ok ( await openedEditor ) ;
75
75
assert . strictEqual ( editor . notebook . uri . toString ( ) , resource . toString ( ) ) ;
76
- } ) ;
76
+ } ) ) ;
77
77
78
78
test ( 'Active/Visible Editor' , async function ( ) {
79
79
const firstEditorOpen = onDidOpenNotebookEditor ( ) ;
Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ export function delay(ms: number) {
66
66
return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
67
67
}
68
68
69
- export function withLogDisabled ( runnable : ( ) => Promise < any > ) : ( ) => Promise < void > {
69
+ function withLogLevel ( level : string , runnable : ( ) => Promise < any > ) : ( ) => Promise < void > {
70
70
return async ( ) : Promise < void > => {
71
71
const logLevel = await vscode . commands . executeCommand ( '_extensionTests.getLogLevel' ) ;
72
- await vscode . commands . executeCommand ( '_extensionTests.setLogLevel' , 'off' ) ;
72
+ await vscode . commands . executeCommand ( '_extensionTests.setLogLevel' , level ) ;
73
73
74
74
try {
75
75
await runnable ( ) ;
@@ -79,6 +79,14 @@ export function withLogDisabled(runnable: () => Promise<any>): () => Promise<voi
79
79
} ;
80
80
}
81
81
82
+ export function withLogDisabled ( runnable : ( ) => Promise < any > ) : ( ) => Promise < void > {
83
+ return withLogLevel ( 'off' , runnable ) ;
84
+ }
85
+
86
+ export function withVerboseLogs ( runnable : ( ) => Promise < any > ) : ( ) => Promise < void > {
87
+ return withLogLevel ( 'trace' , runnable ) ;
88
+ }
89
+
82
90
export function assertNoRpc ( ) {
83
91
assertNoRpcFromEntry ( [ vscode , 'vscode' ] ) ;
84
92
}
You can’t perform that action at this time.
0 commit comments