Skip to content

Commit 133b25b

Browse files
committed
Add test to check that the extension does not cause issues with non-qmd files
1 parent abf1139 commit 133b25b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello World")

apps/vscode/src/test/quartoDoc.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ suite("Quarto basics", function () {
4141
roundtripSnapshotTest('capsule-leak.qmd');
4242

4343
roundtripSnapshotTest('attr-equals.qmd');
44+
45+
// a test to prevent situations like https://github.com/quarto-dev/quarto/issues/845
46+
test("Can open a non-qmd file normally", async function () {
47+
const { editor, doc } = await openAndShowTextDocument("hello.lua");
48+
49+
editor.edit((editBuilder) => {
50+
editBuilder.insert(new vscode.Position(0, 0), 'print("hiyo")\n');
51+
});
52+
doc.save();
53+
54+
await wait(1700); // approximate time to open visual editor, just in case
55+
56+
assert.equal(vscode.window.activeTextEditor, editor, 'quarto extension interferes with other files opened in VSCode!');
57+
});
4458
});
4559

4660
/**

0 commit comments

Comments
 (0)