Skip to content

Commit 70e8733

Browse files
committed
various additional test fixes
1 parent d73e19d commit 70e8733

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/test/hover-values.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import assert from 'assert';
44

55

66
suite('hover values', () => {
7-
let editor: vscode.TextEditor;
87
suiteSetup(async() => {
98
await activateExtension();
10-
editor = await openTestFile('hover-values-example.R');
119
});
1210

1311
const tc = async(pos: vscode.Position, expected: string) => {
12+
const editor = await openTestFile('hover-values-example.R');
1413
const result: vscode.Hover[] = await vscode.commands.executeCommand('vscode.executeHoverProvider', editor.document.uri, pos);
1514
assert.ok(result, 'failed to get result');
1615
assert.equal(result.length, 1, `expected 1 result but got ${result.length}`);

src/test/test-util.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ import type { FlowrInternalSession } from '../flowr/internal-session';
77
import type { FlowrExtensionApi } from '../extension';
88

99
/**
10-
* Activate the extension and return its {@link FlowrExtensionApi}
10+
* Activate the extension (if not already active) and return its {@link FlowrExtensionApi}
1111
*/
1212
export async function activateExtension(): Promise<FlowrExtensionApi> {
1313
const ext = vscode.extensions.getExtension('code-inspect.vscode-flowr');
1414

1515
assert.notEqual(ext, undefined, 'extension not found');
1616

1717
await assert.doesNotReject(async() => {
18-
await ext?.activate();
18+
if(!ext?.isActive) {
19+
await ext?.activate();
20+
}
1921
}, 'extension activation failed');
2022

2123
const api = (ext as vscode.Extension<FlowrExtensionApi>).exports;
2224
assert.notEqual(api, undefined, 'extension api not found');
2325

24-
// force start a local shell and wait, since there seem to be some async issues with commands
26+
// force (re-)start local shell and wait, since there seem to be some async issues with commands
2527
const session: FlowrInternalSession = await vscode.commands.executeCommand('vscode-flowr.session.internal');
2628
assert.equal(session.state, 'active');
2729

0 commit comments

Comments
 (0)