@@ -14,7 +14,9 @@ async function createRandomNotebookFile() {
14
14
}
15
15
16
16
async function openRandomNotebookDocument ( ) {
17
+ console . log ( 'Creating a random notebook file' ) ;
17
18
const uri = await createRandomNotebookFile ( ) ;
19
+ console . log ( 'Created a random notebook file' ) ;
18
20
return vscode . workspace . openNotebookDocument ( uri ) ;
19
21
}
20
22
@@ -119,6 +121,7 @@ const apiTestSerializer: vscode.NotebookSerializer = {
119
121
}
120
122
]
121
123
} ;
124
+ console . log ( 'Returning NotebookData in deserializeNotebook' ) ;
122
125
return dto ;
123
126
}
124
127
} ;
@@ -159,39 +162,61 @@ const apiTestSerializer: vscode.NotebookSerializer = {
159
162
} ) ;
160
163
161
164
test ( 'cell execute command takes arguments' , async ( ) => {
165
+ console . log ( 'Step1.cell execute command takes arguments' ) ;
162
166
const notebook = await openRandomNotebookDocument ( ) ;
167
+ console . log ( 'Step2.cell execute command takes arguments' ) ;
163
168
await vscode . window . showNotebookDocument ( notebook ) ;
169
+ console . log ( 'Step3.cell execute command takes arguments' ) ;
164
170
assert . strictEqual ( vscode . window . activeNotebookEditor !== undefined , true , 'notebook first' ) ;
165
171
const editor = vscode . window . activeNotebookEditor ! ;
166
172
const cell = editor . notebook . cellAt ( 0 ) ;
167
173
174
+ console . log ( 'Step4.cell execute command takes arguments' ) ;
168
175
await withEvent ( vscode . workspace . onDidChangeNotebookDocument , async event => {
176
+ console . log ( 'Step5.cell execute command takes arguments' ) ;
169
177
await vscode . commands . executeCommand ( 'notebook.execute' ) ;
178
+ console . log ( 'Step6.cell execute command takes arguments' ) ;
170
179
await event ;
180
+ console . log ( 'Step7.cell execute command takes arguments' ) ;
171
181
assert . strictEqual ( cell . outputs . length , 1 , 'should execute' ) ; // runnable, it worked
172
182
} ) ;
173
183
184
+ console . log ( 'Step8.cell execute command takes arguments' ) ;
174
185
await withEvent ( vscode . workspace . onDidChangeNotebookDocument , async event => {
186
+ console . log ( 'Step9.cell execute command takes arguments' ) ;
175
187
await vscode . commands . executeCommand ( 'notebook.cell.clearOutputs' ) ;
188
+ console . log ( 'Step10.cell execute command takes arguments' ) ;
176
189
await event ;
190
+ console . log ( 'Step11.cell execute command takes arguments' ) ;
177
191
assert . strictEqual ( cell . outputs . length , 0 , 'should clear' ) ;
178
192
} ) ;
179
193
194
+ console . log ( 'Step12.cell execute command takes arguments' ) ;
180
195
const secondResource = await createRandomNotebookFile ( ) ;
196
+ console . log ( 'Step13.cell execute command takes arguments' ) ;
181
197
const secondDocument = await vscode . workspace . openNotebookDocument ( secondResource ) ;
198
+ console . log ( 'Step14.cell execute command takes arguments' ) ;
182
199
await vscode . window . showNotebookDocument ( secondDocument ) ;
200
+ console . log ( 'Step15.cell execute command takes arguments' ) ;
183
201
184
202
await withEvent < vscode . NotebookDocumentChangeEvent > ( vscode . workspace . onDidChangeNotebookDocument , async event => {
203
+ console . log ( 'Step16.cell execute command takes arguments' ) ;
185
204
await vscode . commands . executeCommand ( 'notebook.cell.execute' , { start : 0 , end : 1 } , notebook . uri ) ;
205
+ console . log ( 'Step17.cell execute command takes arguments' ) ;
186
206
await event ;
207
+ console . log ( 'Step18.cell execute command takes arguments' ) ;
187
208
assert . strictEqual ( cell . outputs . length , 1 , 'should execute' ) ; // runnable, it worked
188
209
assert . strictEqual ( vscode . window . activeNotebookEditor ?. notebook . uri . fsPath , secondResource . fsPath ) ;
189
210
} ) ;
211
+ console . log ( 'Step19.cell execute command takes arguments' ) ;
190
212
} ) ;
191
213
192
214
test ( 'cell execute command takes arguments 2' , async ( ) => {
215
+ console . log ( 'Step1.cell execute command takes arguments 2' ) ;
193
216
const notebook = await openRandomNotebookDocument ( ) ;
217
+ console . log ( 'Step2.cell execute command takes arguments 2' ) ;
194
218
await vscode . window . showNotebookDocument ( notebook ) ;
219
+ console . log ( 'Step3.cell execute command takes arguments 2' ) ;
195
220
196
221
let firstCellExecuted = false ;
197
222
let secondCellExecuted = false ;
0 commit comments