@@ -115,7 +115,12 @@ suiteMandatory('Kernel API Tests @typescript', function () {
115
115
116
116
// Even after starting a kernel the API should not return anything,
117
117
// as no code has been executed against this kernel.
118
- await realKernel . start ( ) ;
118
+ await realKernel . start ( {
119
+ disableUI : true ,
120
+ onDidChangeDisableUI : ( ) => ( {
121
+ dispose : noop
122
+ } )
123
+ } ) ;
119
124
assert . isUndefined ( await kernels . getKernel ( notebook . uri ) ) ;
120
125
121
126
// Ensure user has executed some code against this kernel.
@@ -253,7 +258,7 @@ suiteMandatory('Kernel API Tests @typescript', function () {
253
258
const source = new CancellationTokenSource ( ) ;
254
259
let startEventCounter = 0 ;
255
260
disposables . push (
256
- kernels . onDidStart ( ( { kernel } ) => {
261
+ kernels . onDidStart ( async ( { kernel } ) => {
257
262
const codeToRun =
258
263
startEventCounter === 0 ? `let foo = ${ startEventCounter } ` : `foo = ${ startEventCounter } ` ;
259
264
startEventCounter ++ ;
@@ -280,10 +285,10 @@ suiteMandatory('Kernel API Tests @typescript', function () {
280
285
disposables . push ( eventHandler ) ;
281
286
await Promise . all ( [ runCell ( cell ) , waitForExecutionCompletedSuccessfully ( cell ) , executionOrderSet . promise ] ) ;
282
287
283
- // Validate the cell execution output is equal to the expected value of "foo = 1 "
288
+ // Validate the cell execution output is equal to the expected value of "foo = 0 "
284
289
const expectedMime = NotebookCellOutputItem . stdout ( '' ) . mime ;
285
290
assert . isTrue (
286
- cellHasOutput ( cell , '1 ' , expectedMime ) ,
291
+ await cellHasOutput ( cell , '0 ' , expectedMime ) ,
287
292
'Invalid output, kernel start hook should execute code first'
288
293
) ;
289
294
@@ -297,7 +302,10 @@ suiteMandatory('Kernel API Tests @typescript', function () {
297
302
298
303
// Running the same cell again should not fire additional events
299
304
await Promise . all ( [ runCell ( cell ) , waitForExecutionCompletedSuccessfully ( cell ) , executionOrderSet . promise ] ) ;
300
- assert . isTrue ( cellHasOutput ( cell , '1' , expectedMime ) ) ;
305
+ assert . isTrue (
306
+ await cellHasOutput ( cell , '0' , expectedMime ) ,
307
+ 'Invalid output, kernel start hook should only execute once'
308
+ ) ;
301
309
assert . equal ( startEventCounter , 1 , 'Start event should not be triggered more than once' ) ;
302
310
} ) ;
303
311
0 commit comments