Add Notebook Completion Item Provider Unit Tests (#11222)

* completion item provider tests

* Add nb completionItemProvider tests
This commit is contained in:
Chris LaFreniere
2020-07-07 12:48:22 -07:00
committed by GitHub
parent f409abfc01
commit 5f8180ebbf
3 changed files with 260 additions and 1 deletions

View File

@@ -20,6 +20,10 @@ describe('notebookUtils Tests', function (): void {
let notebookUtils: NotebookUtils;
let apiWrapperMock: TypeMoq.IMock<ApiWrapper>;
this.beforeAll(async function(): Promise<void> {
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
});
beforeEach(function (): void {
apiWrapperMock = TypeMoq.Mock.ofInstance(new ApiWrapper());
notebookUtils = new NotebookUtils(apiWrapperMock.object);
@@ -185,7 +189,7 @@ describe('notebookUtils Tests', function (): void {
nodeSubType: undefined,
nodeType: undefined
}
}
};
await notebookUtils.analyzeNotebook(oeContext);
should(notebookEditor.document.cells.length).equal(1, 'One cell should exist');
should(notebookEditor.document.cells[0].contents.cell_type).equal(CellTypes.Code, 'Cell was created with incorrect type');