From 32c616512d428cb392badfcde7d7ee69b37bfb94 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:45:29 -0700 Subject: [PATCH] Final polish --- test/api/TestUtils.ts | 7 ++++--- test/playwright/TestUtils.ts | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/api/TestUtils.ts b/test/api/TestUtils.ts index 56318439..288a3c07 100644 --- a/test/api/TestUtils.ts +++ b/test/api/TestUtils.ts @@ -43,11 +43,12 @@ export async function timeout(ms: number): Promise { return new Promise(r => setTimeout(r, ms)); } -export async function openTerminal(page: playwright.Page, options: ITerminalOptions & ITerminalInitOnlyOptions = {}, testOptions: any = { loadUnicodeGraphemesAddon: true}): Promise { +export async function openTerminal(page: playwright.Page, options: ITerminalOptions & ITerminalInitOnlyOptions = {}, testOptions: { loadUnicodeGraphemesAddon: boolean } = { loadUnicodeGraphemesAddon: true }): Promise { await page.evaluate(`window.term = new Terminal(${JSON.stringify({ allowProposedApi: true, ...options })})`); await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`); - - // See https://github.com/xtermjs/xterm.js/pull/4519#discussion_r1285234453 + + // HACK: This is a soft layer breaker that's temporarily included until unicode graphemes have + // more complete integration tests. See https://github.com/xtermjs/xterm.js/pull/4519#discussion_r1285234453 if (testOptions.loadUnicodeGraphemesAddon) { await page.evaluate(` window.unicode = new UnicodeGraphemesAddon(); diff --git a/test/playwright/TestUtils.ts b/test/playwright/TestUtils.ts index 65bfb459..0a51757f 100644 --- a/test/playwright/TestUtils.ts +++ b/test/playwright/TestUtils.ts @@ -351,7 +351,7 @@ class TerminalCoreProxy { } } -export async function openTerminal(ctx: ITestContext, options: ITerminalOptions | ITerminalInitOnlyOptions = {}, testOptions: any = { loadUnicodeGraphemesAddon: true}): Promise { +export async function openTerminal(ctx: ITestContext, options: ITerminalOptions | ITerminalInitOnlyOptions = {}, testOptions: { loadUnicodeGraphemesAddon: boolean } = { loadUnicodeGraphemesAddon: true }): Promise { await ctx.page.evaluate(` if ('term' in window) { try { @@ -366,7 +366,8 @@ export async function openTerminal(ctx: ITestContext, options: ITerminalOptions window.term = new window.Terminal(${JSON.stringify({ allowProposedApi: true, ...options })}); window.term.open(document.querySelector('#terminal-container')); `); - // See https://github.com/xtermjs/xterm.js/pull/4519#discussion_r1285234453 + // HACK: This is a soft layer breaker that's temporarily included until unicode graphemes have + // more complete integration tests. See https://github.com/xtermjs/xterm.js/pull/4519#discussion_r1285234453 if (testOptions.loadUnicodeGraphemesAddon) { await ctx.page.evaluate(` window.unicode = new UnicodeGraphemesAddon();