Skip to content

Commit 37906bf

Browse files
Fix a test.
1 parent 4a5875b commit 37906bf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/test/datascience/nativeEditor.functional.test.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import { anything, when } from 'ts-mockito';
1414
import * as TypeMoq from 'typemoq';
1515
import { Disposable, TextDocument, TextEditor, Uri, WindowState } from 'vscode';
1616
import { IApplicationShell, IDocumentManager } from '../../client/common/application/types';
17+
import { FileSystem } from '../../client/common/platform/fileSystem';
18+
import { TemporaryFile } from '../../client/common/platform/types';
1719
import { createDeferred } from '../../client/common/utils/async';
18-
import { createTemporaryFile } from '../../client/common/utils/fs';
1920
import { noop } from '../../client/common/utils/misc';
2021
import { Identifiers } from '../../client/datascience/constants';
2122
import { 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

Comments
 (0)