-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.test.ts
47 lines (42 loc) · 1.47 KB
/
extension.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import * as assert from 'assert';
import * as vscode from 'vscode';
import { Commands } from '../src/commands';
suite('Fabric8 Analytics Extension', () => {
test('Extension should be present', () => {
assert.ok(vscode.extensions.getExtension('redhat.fabric8-analytics'));
});
test('should activate', async () => {
const api = await vscode.extensions
.getExtension('redhat.fabric8-analytics')
.activate();
assert.ok(true);
}).timeout(1 * 60 * 1000);
test('should register all fabric8 commands', async function () {
const FABRIC8_COMMANDS: string[] = [
Commands.TRIGGER_FULL_STACK_ANALYSIS,
Commands.TRIGGER_STACK_LOGS,
Commands.TRIGGER_FULL_STACK_ANALYSIS_FROM_EDITOR,
Commands.TRIGGER_FULL_STACK_ANALYSIS_FROM_EXPLORER,
Commands.TRIGGER_FULL_STACK_ANALYSIS_FROM_PIE_BTN,
Commands.TRIGGER_FULL_STACK_ANALYSIS_FROM_STATUS_BAR,
];
// @ts-ignore
assert.ok((await vscode.commands.getCommands(true)).includes(...FABRIC8_COMMANDS));
});
test('should trigger fabric8-analytics full stack report activate', async () => {
await vscode.commands
.executeCommand(Commands.TRIGGER_FULL_STACK_ANALYSIS)
.then(
(res) => {
assert.ok(true);
},
(reason: any) => {
assert.equal(reason.name, 'Error');
assert.equal(
reason.message,
`Running the contributed command: 'fabric8.stackAnalysis' failed.`
);
}
);
});
});