File tree Expand file tree Collapse file tree
extensions/vscode-notebook-tests/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ import * as assert from 'assert';
88import * as vscode from 'vscode' ;
99import { join } from 'path' ;
1010
11+ export function timeoutAsync ( n : number ) : Promise < void > {
12+ return new Promise ( resolve => {
13+ setTimeout ( ( ) => {
14+ resolve ( ) ;
15+ } , n ) ;
16+ } ) ;
17+ }
18+
1119export function once < T > ( event : vscode . Event < T > ) : vscode . Event < T > {
1220 return ( listener : any , thisArgs = null , disposables ?: any ) => {
1321 // we need this, in case the event fires during the listener call
@@ -103,14 +111,14 @@ suite('API tests', () => {
103111 await vscode . commands . executeCommand ( 'vscode.openWith' , resource , 'notebookCoreTest' ) ;
104112 assert . equal ( count , 1 ) ;
105113
106- await vscode . commands . executeCommand ( 'workbench.action. splitEditor' ) ;
114+ await splitEditor ( ) ;
107115 assert . equal ( count , 2 ) ;
108116
109117 await vscode . commands . executeCommand ( 'workbench.action.closeAllEditors' ) ;
110118 assert . equal ( count , 0 ) ;
111119 } ) ;
112120
113- test ( 'editor editing event' , async function ( ) {
121+ test ( 'editor editing event 2 ' , async function ( ) {
114122 const resource = vscode . Uri . parse ( join ( vscode . workspace . rootPath || '' , './first.vsctestnb' ) ) ;
115123 await vscode . commands . executeCommand ( 'vscode.openWith' , resource , 'notebookCoreTest' ) ;
116124
You can’t perform that action at this time.
0 commit comments