Skip to content

Commit 093e7e5

Browse files
committedMar 24, 2025·
test(editor): add oxc.showOutputChannel command test (#9986)
1 parent ad06194 commit 093e7e5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
 

‎editors/vscode/client/extension.spec.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { deepStrictEqual } from 'assert';
2-
import { commands, extensions } from 'vscode';
1+
import { deepStrictEqual, notEqual, strictEqual } from 'assert';
2+
import { commands, extensions, window } from 'vscode';
33

44
// const WORKSPACE_DIR = workspace.workspaceFolders![0].uri.toString();
55
// const filePath = WORKSPACE_DIR + '/debugger.js';
66
// const fileUri = Uri.parse(filePath);
77

8+
const sleep = (time: number) => new Promise((r) => setTimeout(r, time));
9+
810
suite('commands', () => {
911
setup(async () => {
1012
const ext = extensions.getExtension('oxc.oxc-vscode')!;
@@ -29,6 +31,15 @@ suite('commands', () => {
2931
], oxcCommands);
3032
});
3133

34+
test('oxc.showOutputChannel', async () => {
35+
await commands.executeCommand('oxc.showOutputChannel');
36+
await sleep(500);
37+
38+
notEqual(window.activeTextEditor, undefined);
39+
const uri = window.activeTextEditor!.document.uri;
40+
strictEqual(uri.toString(), 'output:oxc.oxc-vscode.Oxc');
41+
});
42+
3243
// ToDo: check why this is not working,
3344
// even with .gitignore deleted in th test_workspace
3445
//

0 commit comments

Comments
 (0)
Please sign in to comment.