Revert some formatting and remove puppeteer

This commit is contained in:
Jon Bockhorst
2020-02-11 13:32:55 -06:00
parent 8fb6ded506
commit 391313cd39
6 changed files with 260 additions and 275 deletions
+8 -8
View File
@@ -15,7 +15,7 @@ const width = 1024;
const height = 768;
describe('FitAddon', () => {
before(async function (): Promise<any> {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
@@ -31,7 +31,7 @@ describe('FitAddon', () => {
await browser.close();
});
it('no terminal', async function (): Promise<any> {
it('no terminal', async function(): Promise<any> {
await page.evaluate(`window.fit = new FitAddon();`);
assert.equal(await page.evaluate(`window.fit.proposeDimensions()`), undefined);
});
@@ -41,7 +41,7 @@ describe('FitAddon', () => {
return unloadFit();
});
it('default', async function (): Promise<any> {
it('default', async function(): Promise<any> {
await loadFit();
assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), {
cols: 87,
@@ -49,7 +49,7 @@ describe('FitAddon', () => {
});
});
it('width', async function (): Promise<any> {
it('width', async function(): Promise<any> {
await loadFit(1008);
assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), {
cols: 110,
@@ -57,7 +57,7 @@ describe('FitAddon', () => {
});
});
it('small', async function (): Promise<any> {
it('small', async function(): Promise<any> {
await loadFit(1, 1);
assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), {
cols: 2,
@@ -71,21 +71,21 @@ describe('FitAddon', () => {
return unloadFit();
});
it('default', async function (): Promise<any> {
it('default', async function(): Promise<any> {
await loadFit();
await page.evaluate(`window.fit.fit()`);
assert.equal(await page.evaluate(`window.term.cols`), 87);
assert.equal(await page.evaluate(`window.term.rows`), 26);
});
it('width', async function (): Promise<any> {
it('width', async function(): Promise<any> {
await loadFit(1008);
await page.evaluate(`window.fit.fit()`);
assert.equal(await page.evaluate(`window.term.cols`), 110);
assert.equal(await page.evaluate(`window.term.rows`), 26);
});
it('small', async function (): Promise<any> {
it('small', async function(): Promise<any> {
await loadFit(1, 1);
await page.evaluate(`window.fit.fit()`);
assert.equal(await page.evaluate(`window.term.cols`), 2);
-1
View File
@@ -52,7 +52,6 @@
"node-pty": "^0.9.0",
"nyc": "13",
"playwright": "^0.10.0",
"puppeteer": "^1.15.0",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.0.4",
"tslint": "^5.18.0",
+8 -8
View File
@@ -14,8 +14,8 @@ let page: Page;
const width = 800;
const height = 600;
describe('CharWidth Integration Tests', function (): void {
before(async function (): Promise<any> {
describe('CharWidth Integration Tests', function(): void {
before(async function(): Promise<any> {
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -35,37 +35,37 @@ describe('CharWidth Integration Tests', function (): void {
await page.evaluate(`window.term.reset()`);
});
it('ASCII chars', async function (): Promise<void> {
it('ASCII chars', async function(): Promise<void> {
const input = 'This is just ASCII text.#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 25);
});
it('combining chars', async function (): Promise<void> {
it('combining chars', async function(): Promise<void> {
const input = 'e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301e\u0301#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 10);
});
it('surrogate chars', async function (): Promise<void> {
it('surrogate chars', async function(): Promise<void> {
const input = '𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞𝄞#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 28);
});
it('surrogate combining chars', async function (): Promise<void> {
it('surrogate combining chars', async function(): Promise<void> {
const input = '𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301𓂀\u0301#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 12);
});
it('fullwidth chars', async function (): Promise<void> {
it('fullwidth chars', async function(): Promise<void> {
const input = '1234567890#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 21);
});
it('fullwidth chars offset 1', async function (): Promise<void> {
it('fullwidth chars offset 1', async function(): Promise<void> {
const input = 'a1234567890#';
await page.evaluate(`window.term.write('${input}')`);
await pollFor(page, () => sumWidths(0, 1, '#'), 22);
+25 -25
View File
@@ -15,8 +15,8 @@ let page: Page;
const width = 800;
const height = 600;
describe('InputHandler Integration Tests', function (): void {
before(async function (): Promise<any> {
describe('InputHandler Integration Tests', function(): void {
before(async function(): Promise<any> {
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -36,7 +36,7 @@ describe('InputHandler Integration Tests', function (): void {
await page.evaluate(`window.term.reset()`);
});
it('ICH: Insert Ps (Blank) Character(s) (default = 1) - CSI Ps @', async function (): Promise<any> {
it('ICH: Insert Ps (Blank) Character(s) (default = 1) - CSI Ps @', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('foo\\x1b[3D\\x1b[@\\n\\r')
@@ -46,7 +46,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(2), [' foo', ' bar']);
});
it('CUU: Cursor Up Ps Times (default = 1) - CSI Ps A', async function (): Promise<any> {
it('CUU: Cursor Up Ps Times (default = 1) - CSI Ps A', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\\n\\n\\n\\n\x1b[Aa')
@@ -56,7 +56,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(4), ['', ' b', '', 'a']);
});
it('CUD: Cursor Down Ps Times (default = 1) - CSI Ps B', async function (): Promise<any> {
it('CUD: Cursor Down Ps Times (default = 1) - CSI Ps B', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\x1b[Ba')
@@ -66,7 +66,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', ' b']);
});
it('CUF: Cursor Forward Ps Times (default = 1) - CSI Ps C', async function (): Promise<any> {
it('CUF: Cursor Forward Ps Times (default = 1) - CSI Ps C', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\x1b[Ca')
@@ -76,7 +76,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(1), [' a b']);
});
it('CUB: Cursor Backward Ps Times (default = 1) - CSI Ps D', async function (): Promise<any> {
it('CUB: Cursor Backward Ps Times (default = 1) - CSI Ps D', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('foo\x1b[Da')
@@ -86,7 +86,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(1), ['fba']);
});
it('CNL: Cursor Next Line Ps Times (default = 1) - CSI Ps E', async function (): Promise<any> {
it('CNL: Cursor Next Line Ps Times (default = 1) - CSI Ps E', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\x1b[Ea')
@@ -96,7 +96,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', 'b']);
});
it('CPL: Cursor Preceding Line Ps Times (default = 1) - CSI Ps F', async function (): Promise<any> {
it('CPL: Cursor Preceding Line Ps Times (default = 1) - CSI Ps F', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\\n\\n\\n\\n\x1b[Fa')
@@ -106,7 +106,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(5), ['', 'b', '', 'a', '']);
});
it('CHA: Cursor Character Absolute [column] (default = [row,1]) - CSI Ps G', async function (): Promise<any> {
it('CHA: Cursor Character Absolute [column] (default = [row,1]) - CSI Ps G', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('foo\x1b[Ga')
@@ -116,7 +116,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(1), ['aoo b']);
});
it('CUP: Cursor Position [row;column] (default = [1,1]) - CSI Ps ; Ps H', async function (): Promise<any> {
it('CUP: Cursor Position [row;column] (default = [1,1]) - CSI Ps ; Ps H', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('foo\x1b[Ha')
@@ -126,7 +126,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(3), ['aoo', '', ' b']);
});
it('CHT: Cursor Forward Tabulation Ps tab stops (default = 1) - CSI Ps I', async function (): Promise<any> {
it('CHT: Cursor Forward Tabulation Ps tab stops (default = 1) - CSI Ps I', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('\x1b[Ia')
@@ -136,7 +136,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(2), [' a', ' b']);
});
it('ED: Erase in Display, VT100 - CSI Ps J', async function (): Promise<any> {
it('ED: Erase in Display, VT100 - CSI Ps J', async function(): Promise<any> {
const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H';
await page.evaluate(`
// Default: Erase Below
@@ -165,7 +165,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']);
});
it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function (): Promise<any> {
it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function(): Promise<any> {
const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H';
await page.evaluate(`
// Default: Erase Below
@@ -194,7 +194,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']);
});
it('IL: Insert Ps Line(s) (default = 1) - CSI Ps L', async function (): Promise<any> {
it('IL: Insert Ps Line(s) (default = 1) - CSI Ps L', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('foo\x1b[La')
@@ -204,7 +204,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(4), ['b', '', 'a', 'foo']);
});
it('DL: Delete Ps Line(s) (default = 1) - CSI Ps M', async function (): Promise<any> {
it('DL: Delete Ps Line(s) (default = 1) - CSI Ps M', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('a\\nb\x1b[1F\x1b[M')
@@ -214,7 +214,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => getLinesAsArray(5), [' b', ' f', '', '', '']);
});
it('DCH: Delete Ps Character(s) (default = 1) - CSI Ps P', async function (): Promise<any> {
it('DCH: Delete Ps Character(s) (default = 1) - CSI Ps P', async function(): Promise<any> {
await page.evaluate(`
// Default
window.term.write('abc\x1b[1;1H\x1b[P')
@@ -225,7 +225,7 @@ describe('InputHandler Integration Tests', function (): void {
});
describe('DSR: Device Status Report', () => {
it('Status Report - CSI 5 n', async function (): Promise<any> {
it('Status Report - CSI 5 n', async function(): Promise<any> {
await page.evaluate(`
window.term.onData(e => window.result = e);
window.term.write('\\x1b[5n');
@@ -233,7 +233,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => page.evaluate(`window.result`), '\x1b[0n');
});
it('Report Cursor Position (CPR) - CSI 6 n', async function (): Promise<any> {
it('Report Cursor Position (CPR) - CSI 6 n', async function(): Promise<any> {
await page.evaluate(`window.term.write('\\n\\nfoo')`);
await pollFor(page, () => page.evaluate(`
[window.term.buffer.cursorY, window.term.buffer.cursorX]
@@ -245,7 +245,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => page.evaluate(`window.result`), '\x1b[3;4R');
});
it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async function (): Promise<any> {
it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async function(): Promise<any> {
await page.evaluate(`window.term.write('\\n\\nfoo')`);
await pollFor(page, () => page.evaluate(`
[window.term.buffer.cursorY, window.term.buffer.cursorX]
@@ -286,7 +286,7 @@ describe('InputHandler Integration Tests', function (): void {
await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0);
await page.mouse.up();
});
it('Pm = 2004, Set bracketed paste mode', async function (): Promise<any> {
it('Pm = 2004, Set bracketed paste mode', async function(): Promise<any> {
await pollFor(page, () => simulatePaste('foo'), 'foo');
await page.evaluate(`window.term.write('\x1b[?2004h')`);
await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~');
@@ -296,7 +296,7 @@ describe('InputHandler Integration Tests', function (): void {
});
});
it('REP: Repeat preceding character, ECMA48 - CSI Ps b', async function (): Promise<any> {
it('REP: Repeat preceding character, ECMA48 - CSI Ps b', async function(): Promise<any> {
// default to 1
await page.evaluate(`
window.term.resize(10, 10);
@@ -347,7 +347,7 @@ describe('InputHandler Integration Tests', function (): void {
});
describe('Window Options - CSI Ps ; Ps ; Ps t', () => {
it('should be disabled by default', async function () {
it('should be disabled by default', async function() {
await page.evaluate(`(() => {
window._stack = [];
const _h = window.term.onData(data => window._stack.push(data));
@@ -360,7 +360,7 @@ describe('InputHandler Integration Tests', function (): void {
})()`);
await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), []);
});
it('14 - GetWinSizePixels', async function () {
it('14 - GetWinSizePixels', async function() {
await page.evaluate(`window.term.setOption('windowOptions', {getWinSizePixels: true});`);
await page.evaluate(`(() => {
window._stack = [];
@@ -371,7 +371,7 @@ describe('InputHandler Integration Tests', function (): void {
const d = await getDimensions();
await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), [`\x1b[4;${d.height};${d.width}t`]);
});
it('16 - GetCellSizePixels', async function () {
it('16 - GetCellSizePixels', async function() {
await page.evaluate(`window.term.setOption('windowOptions', {getCellSizePixels: true});`);
await page.evaluate(`(() => {
window._stack = [];
File diff suppressed because it is too large Load Diff
-14
View File
@@ -4170,20 +4170,6 @@ punycode@^2.1.0:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
puppeteer@^1.15.0:
version "1.15.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.15.0.tgz#1680fac13e51f609143149a5b7fa99eec392b34f"
integrity sha512-D2y5kwA9SsYkNUmcBzu9WZ4V1SGHiQTmgvDZSx6sRYFsgV25IebL4V6FaHjF6MbwLK9C6f3G3pmck9qmwM8H3w==
dependencies:
debug "^4.1.0"
extract-zip "^1.6.6"
https-proxy-agent "^2.2.1"
mime "^2.0.3"
progress "^2.0.1"
proxy-from-env "^1.0.0"
rimraf "^2.6.1"
ws "^6.1.0"
puppeteer@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.17.0.tgz#371957d227a2f450fa74b78e78a2dadb2be7f14f"