Skip to content

Commit

Permalink
Fix env var service tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Apr 11, 2023
1 parent 7b1cf43 commit a9af6dd
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {

test('should persist collections to the storage service and be able to restore from them', () => {
const collection = new Map<string, IEnvironmentVariableMutator>();
collection.set('A', { value: 'a', type: EnvironmentVariableMutatorType.Replace, scope: undefined });
collection.set('B', { value: 'b', type: EnvironmentVariableMutatorType.Append, scope: undefined });
collection.set('C', { value: 'c', type: EnvironmentVariableMutatorType.Prepend, scope: undefined });
collection.set('A', { value: 'a', type: EnvironmentVariableMutatorType.Replace, scope: undefined, variable: 'A' });
collection.set('B', { value: 'b', type: EnvironmentVariableMutatorType.Append, scope: undefined, variable: 'B' });
collection.set('C', { value: 'c', type: EnvironmentVariableMutatorType.Prepend, scope: undefined, variable: 'C' });
environmentVariableService.set('ext1', { map: collection, persistent: true });
deepStrictEqual([...environmentVariableService.mergedCollection.variableMap.entries()], [
['A', [{ extensionIdentifier: 'ext1', type: EnvironmentVariableMutatorType.Replace, value: 'a' }]],
Expand All @@ -69,12 +69,12 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
const collection1 = new Map<string, IEnvironmentVariableMutator>();
const collection2 = new Map<string, IEnvironmentVariableMutator>();
const collection3 = new Map<string, IEnvironmentVariableMutator>();
collection1.set('A', { value: 'a1', type: EnvironmentVariableMutatorType.Append, scope: undefined });
collection1.set('B', { value: 'b1', type: EnvironmentVariableMutatorType.Replace, scope: undefined });
collection2.set('A', { value: 'a2', type: EnvironmentVariableMutatorType.Replace, scope: undefined });
collection2.set('B', { value: 'b2', type: EnvironmentVariableMutatorType.Append, scope: undefined });
collection3.set('A', { value: 'a3', type: EnvironmentVariableMutatorType.Prepend, scope: undefined });
collection3.set('B', { value: 'b3', type: EnvironmentVariableMutatorType.Replace, scope: undefined });
collection1.set('A', { value: 'a1', type: EnvironmentVariableMutatorType.Append, scope: undefined, variable: 'A' });
collection1.set('B', { value: 'b1', type: EnvironmentVariableMutatorType.Replace, scope: undefined, variable: 'B' });
collection2.set('A', { value: 'a2', type: EnvironmentVariableMutatorType.Replace, scope: undefined, variable: 'A' });
collection2.set('B', { value: 'b2', type: EnvironmentVariableMutatorType.Append, scope: undefined, variable: 'B' });
collection3.set('A', { value: 'a3', type: EnvironmentVariableMutatorType.Prepend, scope: undefined, variable: 'A' });
collection3.set('B', { value: 'b3', type: EnvironmentVariableMutatorType.Replace, scope: undefined, variable: 'B' });
environmentVariableService.set('ext1', { map: collection1, persistent: true });
environmentVariableService.set('ext2', { map: collection2, persistent: true });
environmentVariableService.set('ext3', { map: collection3, persistent: true });
Expand All @@ -91,9 +91,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
const collection1 = new Map<string, IEnvironmentVariableMutator>();
const collection2 = new Map<string, IEnvironmentVariableMutator>();
const collection3 = new Map<string, IEnvironmentVariableMutator>();
collection1.set('A', { value: ':a1', type: EnvironmentVariableMutatorType.Append, scope: undefined });
collection2.set('A', { value: 'a2:', type: EnvironmentVariableMutatorType.Prepend, scope: undefined });
collection3.set('A', { value: 'a3', type: EnvironmentVariableMutatorType.Replace, scope: undefined });
collection1.set('A', { value: ':a1', type: EnvironmentVariableMutatorType.Append, scope: undefined, variable: 'A' });
collection2.set('A', { value: 'a2:', type: EnvironmentVariableMutatorType.Prepend, scope: undefined, variable: 'A' });
collection3.set('A', { value: 'a3', type: EnvironmentVariableMutatorType.Replace, scope: undefined, variable: 'A' });
environmentVariableService.set('ext1', { map: collection1, persistent: true });
environmentVariableService.set('ext2', { map: collection2, persistent: true });
environmentVariableService.set('ext3', { map: collection3, persistent: true });
Expand Down

0 comments on commit a9af6dd

Please sign in to comment.