test(overlay): pin an X11 session for Linux assembly tests

Fullscreen recreation only runs outside Hyprland and Sway, and the tests
inherited the running session's compositor variables, so they failed when run
from a Hyprland desktop.
This commit is contained in:
sudacode committed 2026-11-04 23:31:11 -08:00
1 parent c2dac537da
commit 5140b5e9be
1 file changed
+16
+16
View File
@@ -157,6 +157,22 @@ function setup(t: TestContext, options: { platform?: NodeJS.Platform; visible?:
Object.defineProperty(process, 'platform', { value: options.platform, configurable: true });
t.after(() => Object.defineProperty(process, 'platform', { value: originalPlatform }));
}
if (options.platform === 'linux') {
// Fullscreen recreation only runs outside Hyprland and Sway, so pin an X11
// session rather than inheriting the compositor the tests happen to run under.
for (const key of [
'HYPRLAND_INSTANCE_SIGNATURE',
'SWAYSOCK',
'XDG_CURRENT_DESKTOP',
'XDG_SESSION_DESKTOP',
]) {
const original = process.env[key];
delete process.env[key];
t.after(() => {
if (original !== undefined) process.env[key] = original;
});
}
}
const recorder = createRecorder();
const state: FixtureState = {
visible: options.visible ?? false,