This commit is contained in:
Daniel Imms
2019-06-01 09:38:09 -07:00
parent 041bd7a5d1
commit 8a3c60d495
4 changed files with 5 additions and 41 deletions
-28
View File
@@ -51,22 +51,6 @@ describe('Terminal', () => {
});
});
// describe('getOption', () => {
// it('should retrieve the option correctly', () => {
// // In the `options` namespace.
// term.options.cursorBlink = true;
// assert.equal(term.getOption('cursorBlink'), true);
// // On the Terminal instance
// delete term.options.cursorBlink;
// term.options.cursorBlink = false;
// assert.equal(term.getOption('cursorBlink'), false);
// });
// it('should throw when retrieving a non-existant option', () => {
// assert.throws(term.getOption.bind(term, 'fake', true));
// });
// });
describe('events', () => {
it('should fire the onData evnet', (done) => {
term.onData(() => done());
@@ -335,18 +319,6 @@ describe('Terminal', () => {
});
});
// describe('setOption', () => {
// it('should set option correctly', () => {
// term.setOption('cursorBlink', true);
// assert.equal(term.options.cursorBlink, true);
// term.setOption('cursorBlink', false);
// assert.equal(term.options.cursorBlink, false);
// });
// it('should throw when setting a non-existant option', () => {
// assert.throws(term.setOption.bind(term, 'fake', true));
// });
// });
describe('reset', () => {
it('should not affect cursorState', () => {
term.cursorState = 1;
+1 -10
View File
@@ -53,7 +53,7 @@ import { Attributes, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine';
import { applyWindowsMode } from './WindowsMode';
import { ColorManager } from 'ui/ColorManager';
import { RenderCoordinator } from './renderer/RenderCoordinator';
import { IOptionsService } from '../out/common/options/Types';
import { IOptionsService } from 'common/options/Types';
import { OptionsService } from 'common/options/OptionsService';
// Let it work inside Node.js for automated testing purposes.
@@ -259,15 +259,6 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
}
private _setup(): void {
// Object.keys(DEFAULT_OPTIONS).forEach((key) => {
// if (this.options[key] === null || this.options[key] === undefined) {
// this.options[key] = DEFAULT_OPTIONS[key];
// }
// });
// this.context = options.context || window;
// this.document = options.document || document;
// TODO: WHy not document.body?
this._parent = document ? document.body : null;
this.cols = Math.max(this.options.cols, MINIMUM_COLS);
+3 -2
View File
@@ -13,7 +13,7 @@ import { IDisposable, IMarker, IEvent, ISelectionPosition } from 'xterm';
import { Terminal } from './Terminal';
import { AttributeData } from 'core/buffer/BufferLine';
import { IColorManager, IColorSet } from 'ui/Types';
import { IOptionsService } from '../out/common/options/Types';
import { IOptionsService } from 'common/options/Types';
export class TestTerminal extends Terminal {
writeSync(data: string): void {
@@ -30,7 +30,8 @@ export class MockTerminal implements ITerminal {
onTitleChange: IEvent<string>;
onScroll: IEvent<number>;
onKey: IEvent<{ key: string; domEvent: KeyboardEvent; }>;
onRender: IEvent<{ start: number; end: number; }>;
onRender: IEvent<{ start: number
; end: number; }>;
onResize: IEvent<{ cols: number; rows: number; }>;
markers: IMarker[];
optionsService: IOptionsService;
+1 -1
View File
@@ -8,7 +8,7 @@ import { ICharset, IAttributeData, ICellData, IBufferLine, CharData } from 'core
import { ICircularList } from 'common/Types';
import { IEvent } from 'common/EventEmitter2';
import { IColorSet } from 'ui/Types';
import { IOptionsService } from '../out/common/options/Types';
import { IOptionsService } from 'common/options/Types';
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;