This commit is contained in:
rebornix
2020-05-20 11:07:27 -07:00
parent d321061c8c
commit de5ddeca61
4 changed files with 22 additions and 9 deletions

View File

@@ -118,7 +118,7 @@ suite('API tests', () => {
]
});
const moveCellEvent = getEventOncePromise<vscode.NotebookCellMoveEvent>(vscode.notebook.onDidChangeNotebookCells);
const moveCellEvent = getEventOncePromise<vscode.NotebookCellsChangeEvent>(vscode.notebook.onDidChangeNotebookCells);
await vscode.commands.executeCommand('notebook.cell.moveUp');
const moveCellEventRet = await moveCellEvent;
assert.deepEqual(moveCellEventRet, {

View File

@@ -50,6 +50,26 @@ export function smokeTestActivate(context: vscode.ExtensionContext): any {
return dto;
},
saveNotebook: async (_document: vscode.NotebookDocument, _cancellation: vscode.CancellationToken) => {
return;
},
saveNotebookAs: async (_targetResource: vscode.Uri, _document: vscode.NotebookDocument, _cancellation: vscode.CancellationToken) => {
return;
}
}));
context.subscriptions.push(vscode.notebook.registerNotebookKernel('notebookSmokeTest', ['*.vsctestnb'], {
label: 'notebookSmokeTest',
executeAllCells: async (_document: vscode.NotebookDocument) => {
for (let i = 0; i < _document.cells.length; i++) {
_document.cells[i].outputs = [{
outputKind: vscode.CellOutputKind.Rich,
data: {
'text/html': ['test output']
}
}];
}
},
executeCell: async (_document: vscode.NotebookDocument, _cell: vscode.NotebookCell | undefined, _token: vscode.CancellationToken) => {
if (!_cell) {
_cell = _document.cells[0];
@@ -63,11 +83,5 @@ export function smokeTestActivate(context: vscode.ExtensionContext): any {
}];
return;
},
saveNotebook: async (_document: vscode.NotebookDocument, _cancellation: vscode.CancellationToken) => {
return;
},
saveNotebookAs: async (_targetResource: vscode.Uri, _document: vscode.NotebookDocument, _cancellation: vscode.CancellationToken) => {
return;
}
}));
}