mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
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:
1 file changed
+16
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user