Clean up
This commit is contained in:
@@ -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', () => {
|
describe('events', () => {
|
||||||
it('should fire the onData evnet', (done) => {
|
it('should fire the onData evnet', (done) => {
|
||||||
term.onData(() => 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', () => {
|
describe('reset', () => {
|
||||||
it('should not affect cursorState', () => {
|
it('should not affect cursorState', () => {
|
||||||
term.cursorState = 1;
|
term.cursorState = 1;
|
||||||
|
|||||||
+1
-10
@@ -53,7 +53,7 @@ import { Attributes, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine';
|
|||||||
import { applyWindowsMode } from './WindowsMode';
|
import { applyWindowsMode } from './WindowsMode';
|
||||||
import { ColorManager } from 'ui/ColorManager';
|
import { ColorManager } from 'ui/ColorManager';
|
||||||
import { RenderCoordinator } from './renderer/RenderCoordinator';
|
import { RenderCoordinator } from './renderer/RenderCoordinator';
|
||||||
import { IOptionsService } from '../out/common/options/Types';
|
import { IOptionsService } from 'common/options/Types';
|
||||||
import { OptionsService } from 'common/options/OptionsService';
|
import { OptionsService } from 'common/options/OptionsService';
|
||||||
|
|
||||||
// Let it work inside Node.js for automated testing purposes.
|
// 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 {
|
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._parent = document ? document.body : null;
|
||||||
|
|
||||||
this.cols = Math.max(this.options.cols, MINIMUM_COLS);
|
this.cols = Math.max(this.options.cols, MINIMUM_COLS);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { IDisposable, IMarker, IEvent, ISelectionPosition } from 'xterm';
|
|||||||
import { Terminal } from './Terminal';
|
import { Terminal } from './Terminal';
|
||||||
import { AttributeData } from 'core/buffer/BufferLine';
|
import { AttributeData } from 'core/buffer/BufferLine';
|
||||||
import { IColorManager, IColorSet } from 'ui/Types';
|
import { IColorManager, IColorSet } from 'ui/Types';
|
||||||
import { IOptionsService } from '../out/common/options/Types';
|
import { IOptionsService } from 'common/options/Types';
|
||||||
|
|
||||||
export class TestTerminal extends Terminal {
|
export class TestTerminal extends Terminal {
|
||||||
writeSync(data: string): void {
|
writeSync(data: string): void {
|
||||||
@@ -30,7 +30,8 @@ export class MockTerminal implements ITerminal {
|
|||||||
onTitleChange: IEvent<string>;
|
onTitleChange: IEvent<string>;
|
||||||
onScroll: IEvent<number>;
|
onScroll: IEvent<number>;
|
||||||
onKey: IEvent<{ key: string; domEvent: KeyboardEvent; }>;
|
onKey: IEvent<{ key: string; domEvent: KeyboardEvent; }>;
|
||||||
onRender: IEvent<{ start: number; end: number; }>;
|
onRender: IEvent<{ start: number
|
||||||
|
; end: number; }>;
|
||||||
onResize: IEvent<{ cols: number; rows: number; }>;
|
onResize: IEvent<{ cols: number; rows: number; }>;
|
||||||
markers: IMarker[];
|
markers: IMarker[];
|
||||||
optionsService: IOptionsService;
|
optionsService: IOptionsService;
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import { ICharset, IAttributeData, ICellData, IBufferLine, CharData } from 'core
|
|||||||
import { ICircularList } from 'common/Types';
|
import { ICircularList } from 'common/Types';
|
||||||
import { IEvent } from 'common/EventEmitter2';
|
import { IEvent } from 'common/EventEmitter2';
|
||||||
import { IColorSet } from 'ui/Types';
|
import { IColorSet } from 'ui/Types';
|
||||||
import { IOptionsService } from '../out/common/options/Types';
|
import { IOptionsService } from 'common/options/Types';
|
||||||
|
|
||||||
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
|
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user