mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Fix scope test
This commit is contained in:
@@ -879,18 +879,22 @@ import { assertNoRpc, poll } from '../utils';
|
||||
collection.append('B', '~b2~');
|
||||
collection.prepend('C', '~c2~');
|
||||
// Verify get for scope
|
||||
const defaultOptions: Required<EnvironmentVariableMutatorOptions> = {
|
||||
applyAtProcessCreation: true,
|
||||
applyAtShellIntegration: false
|
||||
};
|
||||
const expectedScopedCollection = collection.getScopedEnvironmentVariableCollection(scope);
|
||||
deepStrictEqual(expectedScopedCollection.get('A'), { value: 'scoped~a2~', type: EnvironmentVariableMutatorType.Replace, options: {} });
|
||||
deepStrictEqual(expectedScopedCollection.get('B'), { value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: {} });
|
||||
deepStrictEqual(expectedScopedCollection.get('C'), { value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: {} });
|
||||
deepStrictEqual(expectedScopedCollection.get('A'), { value: 'scoped~a2~', type: EnvironmentVariableMutatorType.Replace, options: defaultOptions });
|
||||
deepStrictEqual(expectedScopedCollection.get('B'), { value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: defaultOptions });
|
||||
deepStrictEqual(expectedScopedCollection.get('C'), { value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: defaultOptions });
|
||||
|
||||
// Verify forEach
|
||||
const entries: [string, EnvironmentVariableMutator][] = [];
|
||||
expectedScopedCollection.forEach((v, m) => entries.push([v, m]));
|
||||
deepStrictEqual(entries.map(v => v[1]), [
|
||||
{ value: 'scoped~a2~', type: EnvironmentVariableMutatorType.Replace, options: {} },
|
||||
{ value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: {} },
|
||||
{ value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: {} }
|
||||
{ value: 'scoped~a2~', type: EnvironmentVariableMutatorType.Replace, options: defaultOptions },
|
||||
{ value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: defaultOptions },
|
||||
{ value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: defaultOptions }
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user