mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix scope test
This commit is contained in:
parent
37ad81ccd9
commit
d1be423950
|
@ -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 }
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue