1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Shared Playwright fixture that seeds `localStorage['mobux:renderer']`
// per project so each spec runs under BOTH the xterm-default and the
// sterk-experimental renderers without inline addInitScript boilerplate
// in every test file.
//
// The seed runs via `context.addInitScript`, which fires on every
// document load in the context — including after a manual
// `localStorage.clear()` + reload (the long-press / per-window-view
// tests both do this). For the xterm project, the seed actively
// REMOVES the key so the page boots exactly the way a brand-new
// device's first hit would.
//
// Selection: each project in playwright.config.cjs sets
// `use.renderer = 'xterm' | 'sterk'`. The fixture reads it via
// `testInfo.project.use.renderer`.
//
// `sterkOnly(test)` is a sibling helper for tests that poke
// sterk-internal DOM (`.ace_*`, `window.__sterk._sterk`, etc.). These
// can't be made renderer-agnostic cheaply and we explicitly want
// them to keep running against the experimental backend — they're
// guards for sterk-specific behaviour, not the user-facing contract.
// Renderer-agnostic boot/PTY/settings tests should NOT use this
// helper so they run on the xterm project too.
const base = require;
exports. = base..;
exports. = base.;
// Skip the current test unless we're running under the sterk project.
// Call this as the FIRST line inside any test that pokes
// sterk-internal DOM (`.ace_scroller`, `.ace_line`, `window.__sterk`,
// `getCellMetrics`, etc.). On the xterm project these would assert
// against DOM that doesn't exist — but the behaviour they cover is
// genuinely sterk-only and worth keeping around for that backend.
exports ;