mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
This commit is contained in:
@@ -1001,7 +1001,9 @@ suite('Notebook & LiveShare', function () {
|
||||
suiteDisposables.push(vscode.workspace.registerNotebookSerializer(notebookType, new class implements vscode.NotebookSerializer {
|
||||
deserializeNotebook(content: Uint8Array, _token: vscode.CancellationToken): vscode.NotebookData | Thenable<vscode.NotebookData> {
|
||||
const value = new TextDecoder().decode(content);
|
||||
return new vscode.NotebookData([new vscode.NotebookCellData(vscode.NotebookCellKind.Code, value, 'fooLang')]);
|
||||
const cell1 = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, value, 'fooLang');
|
||||
cell1.outputs = [new vscode.NotebookCellOutput([vscode.NotebookCellOutputItem.stderr(value)])];
|
||||
return new vscode.NotebookData([cell1]);
|
||||
}
|
||||
serializeNotebook(data: vscode.NotebookData, _token: vscode.CancellationToken): Uint8Array | Thenable<Uint8Array> {
|
||||
return new TextEncoder().encode(data.cells[0].value);
|
||||
@@ -1030,6 +1032,7 @@ suite('Notebook & LiveShare', function () {
|
||||
assert.ok(data instanceof vscode.NotebookData);
|
||||
assert.strictEqual(data.cells.length, 1);
|
||||
assert.strictEqual(data.cells[0].value, value);
|
||||
assert.strictEqual(new TextDecoder().decode(data.cells[0].outputs![0].items[0].data), value);
|
||||
});
|
||||
|
||||
test('command: vscode.executeNotebookToData', async function () {
|
||||
|
||||
Reference in New Issue
Block a user