Skip to content

Commit 180c7c4

Browse files
author
Kartik Raj
committed
Fix tests
1 parent 4396943 commit 180c7c4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/test/proposedApi.unit.test.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { PythonEnvCollectionChangedEvent } from '../client/pythonEnvironments/ba
2929
import { normCasePath } from '../client/common/platform/fs-paths';
3030
import {
3131
ActiveEnvironmentIdChangeEvent,
32+
EnvironmentPath,
3233
EnvironmentsChangeEvent,
3334
ProposedExtensionAPI,
3435
} from '../client/proposedApiTypes';
@@ -91,7 +92,11 @@ suite('Proposed Extension API', () => {
9192
.setup((c) => c.getSettings(undefined))
9293
.returns(() => (({ pythonPath } as unknown) as IPythonSettings));
9394
const actual = proposed.environment.getActiveEnvironmentPath();
94-
assert.deepEqual(actual, { id: normCasePath(pythonPath), path: pythonPath });
95+
assert.deepEqual(actual, ({
96+
id: normCasePath(pythonPath),
97+
path: pythonPath,
98+
pathType: 'interpreterPath',
99+
} as unknown) as EnvironmentPath);
95100
});
96101

97102
test('getActiveEnvironmentPath: default python', () => {
@@ -100,7 +105,11 @@ suite('Proposed Extension API', () => {
100105
.setup((c) => c.getSettings(undefined))
101106
.returns(() => (({ pythonPath } as unknown) as IPythonSettings));
102107
const actual = proposed.environment.getActiveEnvironmentPath();
103-
assert.deepEqual(actual, { id: 'DEFAULT_PYTHON', path: pythonPath });
108+
assert.deepEqual(actual, ({
109+
id: 'DEFAULT_PYTHON',
110+
path: pythonPath,
111+
pathType: 'interpreterPath',
112+
} as unknown) as EnvironmentPath);
104113
});
105114

106115
test('getActiveEnvironmentPath: With resource', () => {
@@ -110,7 +119,11 @@ suite('Proposed Extension API', () => {
110119
.setup((c) => c.getSettings(resource))
111120
.returns(() => (({ pythonPath } as unknown) as IPythonSettings));
112121
const actual = proposed.environment.getActiveEnvironmentPath(resource);
113-
assert.deepEqual(actual, { id: normCasePath(pythonPath), path: pythonPath });
122+
assert.deepEqual(actual, ({
123+
id: normCasePath(pythonPath),
124+
path: pythonPath,
125+
pathType: 'interpreterPath',
126+
} as unknown) as EnvironmentPath);
114127
});
115128

116129
test('resolveEnvironment: invalid environment (when passed as string)', async () => {

0 commit comments

Comments
 (0)