@@ -14,8 +14,9 @@ import { anything, when } from 'ts-mockito';
14
14
import * as TypeMoq from 'typemoq' ;
15
15
import { Disposable , TextDocument , TextEditor , Uri , WindowState } from 'vscode' ;
16
16
import { IApplicationShell , IDocumentManager } from '../../client/common/application/types' ;
17
+ import { FileSystem } from '../../client/common/platform/fileSystem' ;
18
+ import { TemporaryFile } from '../../client/common/platform/types' ;
17
19
import { createDeferred } from '../../client/common/utils/async' ;
18
- import { createTemporaryFile } from '../../client/common/utils/fs' ;
19
20
import { noop } from '../../client/common/utils/misc' ;
20
21
import { Identifiers } from '../../client/datascience/constants' ;
21
22
import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes' ;
@@ -327,10 +328,7 @@ suite('DataScience Native Editor', () => {
327
328
{ id : 'NotebookImport#1' , data : { source : 'b=2\nb' } } ,
328
329
{ id : 'NotebookImport#2' , data : { source : 'c=3\nc' } }
329
330
] ;
330
- let notebookFile : {
331
- filePath : string ;
332
- cleanupCallback : Function ;
333
- } ;
331
+ let notebookFile : TemporaryFile ;
334
332
function initIoc ( ) {
335
333
ioc = new DataScienceIocContainer ( ) ;
336
334
ioc . registerDataScienceTypes ( ) ;
@@ -348,7 +346,8 @@ suite('DataScience Native Editor', () => {
348
346
} ) ;
349
347
// Use a real file so we can save notebook to a file.
350
348
// This is used in some tests (saving).
351
- notebookFile = await createTemporaryFile ( '.ipynb' ) ;
349
+ const filesystem = new FileSystem ( ) ;
350
+ notebookFile = await filesystem . createTemporaryFile ( '.ipynb' ) ;
352
351
const notebook = await ioc . get < INotebookExporter > ( INotebookExporter ) . translateToNotebook ( runAllCells , undefined ) ;
353
352
await Promise . all ( [ waitForUpdate ( wrapper , NativeEditor , 1 ) , openEditor ( ioc , JSON . stringify ( notebook ) , notebookFile . filePath ) ] ) ;
354
353
} else {
@@ -370,7 +369,7 @@ suite('DataScience Native Editor', () => {
370
369
}
371
370
await ioc . dispose ( ) ;
372
371
try {
373
- notebookFile . cleanupCallback ( ) ;
372
+ notebookFile . dispose ( ) ;
374
373
} catch {
375
374
noop ( ) ;
376
375
}
0 commit comments