-
Notifications
You must be signed in to change notification settings - Fork 752
Expand file tree
/
Copy pathcommandEnablement.integration.test.ts
More file actions
54 lines (45 loc) · 2.02 KB
/
commandEnablement.integration.test.ts
File metadata and controls
54 lines (45 loc) · 2.02 KB
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
48
49
50
51
52
53
54
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { expect, beforeAll, afterAll, describe } from '@jest/globals';
import * as vscode from 'vscode';
import { activateCSharpExtension } from './integrationHelpers';
import testAssetWorkspace from './testAssets/testAssetWorkspace';
import {
RoslynDevKitCommands,
RoslynStandaloneCommands,
UnexpectedRoslynDevKitCommands,
UnexpectedRoslynStandaloneCommands,
} from './expectedCommands';
import { testIfCSharp, testIfDevKit } from '../../jestHelpers';
describe(`Command Enablement Tests`, () => {
beforeAll(async () => {
await activateCSharpExtension();
});
afterAll(async () => {
await testAssetWorkspace.cleanupWorkspace();
});
testIfCSharp('Roslyn standalone commands are available', async () => {
const commands = await vscode.commands.getCommands(true);
// Ensure the standalone Roslyn commands are available.
RoslynStandaloneCommands.forEach((command) => {
expect(commands).toContain(command);
});
// Ensure other commands are not available.
UnexpectedRoslynStandaloneCommands.forEach((command) => {
expect(commands).not.toContain(command);
});
});
testIfDevKit('Roslyn + C# Dev Kit commands are available', async () => {
const commands = await vscode.commands.getCommands(true);
// Ensure the Roslyn + C# Dev Kit commands are available
RoslynDevKitCommands.forEach((command) => {
expect(commands).toContain(command);
});
// Ensure other commands are not available.
UnexpectedRoslynDevKitCommands.forEach((command) => {
expect(commands).not.toContain(command);
});
});
});