chore: lint using putout

This commit is contained in:
coderaiser
2021-05-15 01:17:17 +03:00
parent 24f431b290
commit d046e2a77f
17 changed files with 41 additions and 41 deletions
+15 -15
View File
@@ -29,10 +29,10 @@ describe('Terminal', () => {
beforeEach(() => {
term = new TestTerminal(termOptions);
term.refresh = () => { };
(<any>term).renderer = new MockRenderer();
(term as any).renderer = new MockRenderer();
term.viewport = new MockViewport();
(<any>term)._compositionHelper = new MockCompositionHelper();
(<any>term).element = {
(term as any)._compositionHelper = new MockCompositionHelper();
(term as any).element = {
classList: {
toggle: () => { },
remove: () => { }
@@ -86,12 +86,12 @@ describe('Terminal', () => {
assert.equal(e.domEvent instanceof Object, true);
done();
});
const evKeyPress = <KeyboardEvent>{
const evKeyPress = {
preventDefault: () => { },
stopPropagation: () => { },
type: 'keypress',
keyCode: 13
};
} as KeyboardEvent;
term.keyPress(evKeyPress);
});
it('should fire a key event after a keydown DOM event', (done) => {
@@ -100,13 +100,13 @@ describe('Terminal', () => {
assert.equal(e.domEvent instanceof Object, true);
done();
});
(<any>term).textarea = { value: '' };
const evKeyDown = <KeyboardEvent>{
(term as any).textarea = { value: '' };
const evKeyDown = {
preventDefault: () => { },
stopPropagation: () => { },
type: 'keydown',
keyCode: 13
};
} as KeyboardEvent;
term.keyDown(evKeyDown);
});
it('should fire the onResize event', (done) => {
@@ -140,18 +140,18 @@ describe('Terminal', () => {
});
describe('attachCustomKeyEventHandler', () => {
const evKeyDown = <KeyboardEvent>{
const evKeyDown = {
preventDefault: () => { },
stopPropagation: () => { },
type: 'keydown',
keyCode: 77
};
const evKeyPress = <KeyboardEvent>{
} as KeyboardEvent;
const evKeyPress = {
preventDefault: () => { },
stopPropagation: () => { },
type: 'keypress',
keyCode: 77
};
} as KeyboardEvent;
beforeEach(() => {
term.clearSelection = () => { };
@@ -374,13 +374,13 @@ describe('Terminal', () => {
describe('keyPress', () => {
it('should scroll down, when a key is pressed and terminal is scrolled up', () => {
const event = <KeyboardEvent>{
const event = {
type: 'keydown',
key: 'a',
keyCode: 65,
preventDefault: () => { },
stopPropagation: () => { }
};
} as KeyboardEvent;
term.buffer.ydisp = 0;
term.buffer.ybase = 40;
@@ -403,7 +403,7 @@ describe('Terminal', () => {
assert.equal(term.buffer.ydisp, startYDisp);
term.scrollLines(-1);
assert.equal(term.buffer.ydisp, startYDisp - 1);
term.keyPress(<KeyboardEvent>{ keyCode: 0 });
term.keyPress({ keyCode: 0 } as KeyboardEvent);
assert.equal(term.buffer.ydisp, startYDisp - 1);
});
});