refactor: apply requested style change
This commit is contained in:
@@ -412,7 +412,14 @@ class TerminalCoreProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function openTerminal(ctx: ITestContext, options: ITerminalOptions | ITerminalInitOnlyOptions = {}, { useShadowDom = false, loadUnicodeGraphemesAddon = true }: { loadUnicodeGraphemesAddon?: boolean, useShadowDom?: boolean } = { }): Promise<void> {
|
export async function openTerminal(
|
||||||
|
ctx: ITestContext,
|
||||||
|
options: ITerminalOptions | ITerminalInitOnlyOptions = {},
|
||||||
|
testOptions: { useShadowDom?: boolean, loadUnicodeGraphemesAddon?: boolean } = {}
|
||||||
|
): Promise<void> {
|
||||||
|
testOptions.useShadowDom ??= false;
|
||||||
|
testOptions.loadUnicodeGraphemesAddon ??= true;
|
||||||
|
|
||||||
await ctx.page.evaluate(`
|
await ctx.page.evaluate(`
|
||||||
if ('term' in window) {
|
if ('term' in window) {
|
||||||
try {
|
try {
|
||||||
@@ -435,7 +442,7 @@ export async function openTerminal(ctx: ITestContext, options: ITerminalOptions
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
if (useShadowDom) {
|
if (testOptions.useShadowDom) {
|
||||||
script += `
|
script += `
|
||||||
const shadowRoot = element.attachShadow({ mode: "open" });
|
const shadowRoot = element.attachShadow({ mode: "open" });
|
||||||
|
|
||||||
@@ -464,7 +471,7 @@ export async function openTerminal(ctx: ITestContext, options: ITerminalOptions
|
|||||||
|
|
||||||
// HACK: This is a soft layer breaker that's temporarily included until unicode graphemes have
|
// 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
|
// more complete integration tests. See https://github.com/xtermjs/xterm.js/pull/4519#discussion_r1285234453
|
||||||
if (loadUnicodeGraphemesAddon) {
|
if (testOptions.loadUnicodeGraphemesAddon) {
|
||||||
await ctx.page.evaluate(`
|
await ctx.page.evaluate(`
|
||||||
window.unicode = new UnicodeGraphemesAddon();
|
window.unicode = new UnicodeGraphemesAddon();
|
||||||
window.term.loadAddon(window.unicode);
|
window.term.loadAddon(window.unicode);
|
||||||
|
|||||||
Reference in New Issue
Block a user