mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Revert some formatting and remove puppeteer
This commit is contained in:
@@ -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 = 'οΌοΌοΌοΌοΌοΌοΌοΌοΌοΌ#';
|
||||
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 = 'aοΌοΌοΌοΌοΌοΌοΌοΌοΌοΌ#';
|
||||
await page.evaluate(`window.term.write('${input}')`);
|
||||
await pollFor(page, () => sumWidths(0, 1, '#'), 22);
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
+219
-219
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user