Skip to content

Commit f7f05de

Browse files
committed
Don't require creationOptions to be the same object
Fixes microsoft#102950
1 parent c12abc9 commit f7f05de

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { window, Pseudoterminal, EventEmitter, TerminalDimensions, workspace, ConfigurationTarget, Disposable, UIKind, env, EnvironmentVariableMutatorType, EnvironmentVariableMutator, extensions, ExtensionContext } from 'vscode';
6+
import { window, Pseudoterminal, EventEmitter, TerminalDimensions, workspace, ConfigurationTarget, Disposable, UIKind, env, EnvironmentVariableMutatorType, EnvironmentVariableMutator, extensions, ExtensionContext, TerminalOptions, ExtensionTerminalOptions } from 'vscode';
77
import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
88

99
// Disable terminal tests:
@@ -168,8 +168,10 @@ import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
168168
const terminal = window.createTerminal(options);
169169
try {
170170
equal(terminal.name, 'foo');
171-
deepEqual(terminal.creationOptions, options);
172-
throws(() => (<any>terminal.creationOptions).name = 'bad', 'creationOptions should be readonly at runtime');
171+
const terminalOptions = terminal.creationOptions as TerminalOptions;
172+
equal(terminalOptions.name, 'foo');
173+
equal(terminalOptions.hideFromUser, true);
174+
throws(() => terminalOptions.name = 'bad', 'creationOptions should be readonly at runtime');
173175
} catch (e) {
174176
done(e);
175177
return;
@@ -605,8 +607,10 @@ import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
605607
const terminal = window.createTerminal(options);
606608
try {
607609
equal(terminal.name, 'foo');
608-
deepEqual(terminal.creationOptions, options);
609-
throws(() => (<any>terminal.creationOptions).name = 'bad', 'creationOptions should be readonly at runtime');
610+
const terminalOptions = terminal.creationOptions as ExtensionTerminalOptions;
611+
equal(terminalOptions.name, 'foo');
612+
equal(terminalOptions.pty, pty);
613+
throws(() => terminalOptions.name = 'bad', 'creationOptions should be readonly at runtime');
610614
} catch (e) {
611615
done(e);
612616
}

0 commit comments

Comments
 (0)