Re-enabled some of the skipped notebook tests (#255087)

* Identify flaky test failures

* Updates
This commit is contained in:
Don Jayamanne
2025-07-10 21:05:27 +10:00
committed by GitHub
parent c195156400
commit e31bfcad9d
2 changed files with 33 additions and 6 deletions

View File

@@ -6,13 +6,40 @@
import * as assert from 'assert';
import 'mocha';
import * as vscode from 'vscode';
import { assertNoRpc, closeAllEditors, createRandomFile } from '../utils';
const ipynbContent = JSON.stringify({
"cells": [
{
"cell_type": "markdown",
"source": ["## Header"],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 2,
"source": ["print('hello 1')\n", "print('hello 2')"],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": ["hello 1\n", "hello 2\n"]
}
],
"metadata": {}
}
]
});
suite('ipynb NotebookSerializer', function () {
teardown(async function () {
assertNoRpc();
await closeAllEditors();
});
(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('ipynb NotebookSerializer', function () {
test('Can open an ipynb notebook', async () => {
assert.ok(vscode.workspace.workspaceFolders);
const workspace = vscode.workspace.workspaceFolders[0];
const uri = vscode.Uri.joinPath(workspace.uri, 'test.ipynb');
const notebook = await vscode.workspace.openNotebookDocument(uri);
const file = await createRandomFile(ipynbContent, undefined, '.ipynb');
const notebook = await vscode.workspace.openNotebookDocument(file);
await vscode.window.showNotebookDocument(notebook);
const notebookEditor = vscode.window.activeNotebookEditor;