@@ -14,8 +14,9 @@ import { anything, when } from 'ts-mockito';
1414import * as TypeMoq from 'typemoq' ;
1515import { Disposable , TextDocument , TextEditor , Uri , WindowState } from 'vscode' ;
1616import { IApplicationShell , IDocumentManager } from '../../client/common/application/types' ;
17+ import { FileSystem } from '../../client/common/platform/fileSystem' ;
18+ import { TemporaryFile } from '../../client/common/platform/types' ;
1719import { createDeferred } from '../../client/common/utils/async' ;
18- import { createTemporaryFile } from '../../client/common/utils/fs' ;
1920import { noop } from '../../client/common/utils/misc' ;
2021import { Identifiers } from '../../client/datascience/constants' ;
2122import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes' ;
@@ -327,10 +328,7 @@ suite('DataScience Native Editor', () => {
327328 { id : 'NotebookImport#1' , data : { source : 'b=2\nb' } } ,
328329 { id : 'NotebookImport#2' , data : { source : 'c=3\nc' } }
329330 ] ;
330- let notebookFile : {
331- filePath : string ;
332- cleanupCallback : Function ;
333- } ;
331+ let notebookFile : TemporaryFile ;
334332 function initIoc ( ) {
335333 ioc = new DataScienceIocContainer ( ) ;
336334 ioc . registerDataScienceTypes ( ) ;
@@ -348,7 +346,8 @@ suite('DataScience Native Editor', () => {
348346 } ) ;
349347 // Use a real file so we can save notebook to a file.
350348 // This is used in some tests (saving).
351- notebookFile = await createTemporaryFile ( '.ipynb' ) ;
349+ const filesystem = new FileSystem ( ) ;
350+ notebookFile = await filesystem . createTemporaryFile ( '.ipynb' ) ;
352351 const notebook = await ioc . get < INotebookExporter > ( INotebookExporter ) . translateToNotebook ( runAllCells , undefined ) ;
353352 await Promise . all ( [ waitForUpdate ( wrapper , NativeEditor , 1 ) , openEditor ( ioc , JSON . stringify ( notebook ) , notebookFile . filePath ) ] ) ;
354353 } else {
@@ -370,7 +369,7 @@ suite('DataScience Native Editor', () => {
370369 }
371370 await ioc . dispose ( ) ;
372371 try {
373- notebookFile . cleanupCallback ( ) ;
372+ notebookFile . dispose ( ) ;
374373 } catch {
375374 noop ( ) ;
376375 }
0 commit comments