|
6 | 6 | import { expect } from 'chai';
|
7 | 7 | import * as sinon from 'sinon';
|
8 | 8 | import { instance, mock, when } from 'ts-mockito';
|
| 9 | +import { Terminal } from 'vscode'; |
9 | 10 | import { ApplicationEnvironment } from '../../../../client/common/application/applicationEnvironment';
|
10 | 11 | import { WorkspaceService } from '../../../../client/common/application/workspace';
|
11 | 12 | import { PlatformService } from '../../../../client/common/platform/platformService';
|
@@ -91,7 +92,18 @@ suite('Shell Detectors', () => {
|
91 | 92 | 'Should be undefined when there is no temrinal',
|
92 | 93 | );
|
93 | 94 | });
|
94 |
| - test('Identify shell based on VSC Environment', async () => { |
| 95 | + test('Identify shell based on custom VSC shell path', async () => { |
| 96 | + const shellDetector = new VSCEnvironmentShellDetector(instance(appEnv)); |
| 97 | + shellPathsAndIdentification.forEach((shellType, shellPath) => { |
| 98 | + when(appEnv.shell).thenReturn('defaultshellPath'); |
| 99 | + expect( |
| 100 | + shellDetector.identify(telemetryProperties, ({ |
| 101 | + creationOptions: { shellPath }, |
| 102 | + } as unknown) as Terminal), |
| 103 | + ).to.equal(shellType, `Incorrect Shell Type from identifyShellByTerminalName, for path '${shellPath}'`); |
| 104 | + }); |
| 105 | + }); |
| 106 | + test('Identify shell based on VSC API', async () => { |
95 | 107 | const shellDetector = new VSCEnvironmentShellDetector(instance(appEnv));
|
96 | 108 | shellPathsAndIdentification.forEach((shellType, shellPath) => {
|
97 | 109 | when(appEnv.shell).thenReturn(shellPath);
|
|
0 commit comments