Skip to content

Commit d2f81c8

Browse files
committed
test: install Black formatter extension
1 parent 31d5415 commit d2f81c8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/vscode/src/test/formatting.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ import { openAndShowTextDocument, wait, WORKSPACE_PATH } from "./test-utils";
55

66
suite("Code Block Formatting", function () {
77
test("Format Python code block", async function () {
8+
// Ensure Black formatter extension is installed
9+
await vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-python.black-formatter");
10+
await wait(1000);
11+
const blackFormatterExtension = vscode.extensions.getExtension("ms-python.black-formatter");
12+
assert.notStrictEqual(blackFormatterExtension, undefined, "ms-python.black-formatter extension must be installed");
13+
814
const { doc, editor } = await openAndShowTextDocument("format-python.qmd");
915

10-
const position = new vscode.Position(7, 2); // Line with "1+1"
16+
const position = new vscode.Position(7, 0); // Line with "1+1"
1117
editor.selection = new vscode.Selection(position, position);
18+
await wait(1000);
1219
await vscode.commands.executeCommand("quarto.formatCell");
1320
// await vscode.commands.executeCommand("vscode.executeFormatDocumentProvider", doc.uri);
1421

0 commit comments

Comments
 (0)