Fix tests

This commit is contained in:
Daniel Imms 2021-04-16 06:47:47 -07:00
parent c7d26be9a5
commit f4b60835ea
No known key found for this signature in database
GPG key ID: D12BE8272D6284CC

View file

@ -212,18 +212,14 @@ suite('Workbench - TerminalEnvironment', () => {
suite('getDefaultShell', () => {
test('should change Sysnative to System32 in non-WoW64 systems', () => {
const shell = getDefaultShell(key => {
return ({
'terminal.integrated.shell.windows': { userValue: 'C:\\Windows\\Sysnative\\cmd.exe', value: undefined, defaultValue: undefined }
} as any)[key];
return ({ 'terminal.integrated.shell.windows': 'C:\\Windows\\Sysnative\\cmd.exe' } as any)[key];
}, 'DEFAULT', false, 'C:\\Windows', undefined, {} as any, false, platform.Platform.Windows);
assert.strictEqual(shell, 'C:\\Windows\\System32\\cmd.exe');
});
test('should not change Sysnative to System32 in WoW64 systems', () => {
const shell = getDefaultShell(key => {
return ({
'terminal.integrated.shell.windows': { userValue: 'C:\\Windows\\Sysnative\\cmd.exe', value: undefined, defaultValue: undefined }
} as any)[key];
return ({ 'terminal.integrated.shell.windows': 'C:\\Windows\\Sysnative\\cmd.exe' } as any)[key];
}, 'DEFAULT', true, 'C:\\Windows', undefined, {} as any, false, platform.Platform.Windows);
assert.strictEqual(shell, 'C:\\Windows\\Sysnative\\cmd.exe');
});
@ -231,22 +227,22 @@ suite('Workbench - TerminalEnvironment', () => {
test('should use automationShell when specified', () => {
const shell1 = getDefaultShell(key => {
return ({
'terminal.integrated.shell.windows': { userValue: 'shell', value: undefined, defaultValue: undefined },
'terminal.integrated.automationShell.windows': { userValue: undefined, value: undefined, defaultValue: undefined }
'terminal.integrated.shell.windows': 'shell',
'terminal.integrated.automationShell.windows': undefined
} as any)[key];
}, 'DEFAULT', false, 'C:\\Windows', undefined, {} as any, false, platform.Platform.Windows);
assert.strictEqual(shell1, 'shell', 'automationShell was false');
const shell2 = getDefaultShell(key => {
return ({
'terminal.integrated.shell.windows': { userValue: 'shell', value: undefined, defaultValue: undefined },
'terminal.integrated.automationShell.windows': { userValue: undefined, value: undefined, defaultValue: undefined }
'terminal.integrated.shell.windows': 'shell',
'terminal.integrated.automationShell.windows': undefined
} as any)[key];
}, 'DEFAULT', false, 'C:\\Windows', undefined, {} as any, true, platform.Platform.Windows);
assert.strictEqual(shell2, 'shell', 'automationShell was true');
const shell3 = getDefaultShell(key => {
return ({
'terminal.integrated.shell.windows': { userValue: 'shell', value: undefined, defaultValue: undefined },
'terminal.integrated.automationShell.windows': { userValue: 'automationShell', value: undefined, defaultValue: undefined }
'terminal.integrated.shell.windows': 'shell',
'terminal.integrated.automationShell.windows': 'automationShell'
} as any)[key];
}, 'DEFAULT', false, 'C:\\Windows', undefined, {} as any, true, platform.Platform.Windows);
assert.strictEqual(shell3, 'automationShell', 'automationShell was true and specified in settings');