mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
remove old notebookCellExecutionState proposal (#248522)
re https://github.com/microsoft/vscode/issues/124970#issuecomment-2864279668
This commit is contained in:
@@ -278,38 +278,6 @@ const apiTestSerializer: vscode.NotebookSerializer = {
|
||||
});
|
||||
});
|
||||
|
||||
test('onDidChangeCellExecutionState is fired', async () => {
|
||||
const notebook = await openRandomNotebookDocument();
|
||||
const editor = await vscode.window.showNotebookDocument(notebook);
|
||||
const cell = editor.notebook.cellAt(0);
|
||||
|
||||
let eventCount = 0;
|
||||
const def = new DeferredPromise<void>();
|
||||
testDisposables.push(vscode.notebooks.onDidChangeNotebookCellExecutionState(e => {
|
||||
try {
|
||||
assert.strictEqual(e.cell.document.uri.toString(), cell.document.uri.toString(), 'event should be fired for the executing cell');
|
||||
|
||||
if (eventCount === 0) {
|
||||
assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Pending, 'should be set to Pending');
|
||||
} else if (eventCount === 1) {
|
||||
assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Executing, 'should be set to Executing');
|
||||
assert.strictEqual(cell.outputs.length, 0, 'no outputs yet: ' + JSON.stringify(cell.outputs[0]));
|
||||
} else if (e.state === vscode.NotebookCellExecutionState.Idle) {
|
||||
assert.strictEqual(cell.outputs.length, 1, 'should have an output');
|
||||
def.complete();
|
||||
}
|
||||
|
||||
eventCount++;
|
||||
} catch (err) {
|
||||
def.error(err);
|
||||
}
|
||||
}));
|
||||
|
||||
vscode.commands.executeCommand('notebook.cell.execute', { document: notebook.uri, ranges: [{ start: 0, end: 1 }] });
|
||||
|
||||
await def.p;
|
||||
});
|
||||
|
||||
test('Output changes are applied once the promise resolves', async function () {
|
||||
|
||||
let called = false;
|
||||
|
||||
Reference in New Issue
Block a user