Parcourir la source

test(kitty): set KITTY_LISTEN_ON in test setup

The hasListenOn() guard (added for the silent-failure fix) requires
KITTY_LISTEN_ON, which kitty exports to its children. CI has no kitty
env, so 8 tests failed. Set KITTY_LISTEN_ON in beforeEach (restored in
afterEach) to match the real environment.
adikpb il y a 3 semaines
Parent
commit
df14ed5dd5
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      src/multiplexer/kitty/index.test.ts

+ 4 - 0
src/multiplexer/kitty/index.test.ts

@@ -48,10 +48,13 @@ function commands(): string[][] {
 describe('KittyMultiplexer', () => {
   const originalKittyPid = process.env.KITTY_PID;
   const originalKittyWindowId = process.env.KITTY_WINDOW_ID;
+  const originalKittyListenOn = process.env.KITTY_LISTEN_ON;
 
   beforeEach(() => {
     process.env.KITTY_PID = '12345';
     process.env.KITTY_WINDOW_ID = '1';
+    // kitty exports KITTY_LISTEN_ON to its children; the backend requires it.
+    process.env.KITTY_LISTEN_ON = 'unix:/tmp/kitty-rc-test';
 
     logMock.mockClear();
     crossSpawnMock.mockReset();
@@ -75,6 +78,7 @@ describe('KittyMultiplexer', () => {
   afterEach(() => {
     process.env.KITTY_PID = originalKittyPid;
     process.env.KITTY_WINDOW_ID = originalKittyWindowId;
+    process.env.KITTY_LISTEN_ON = originalKittyListenOn;
   });
 
   test('isAvailable returns true when kitten is found', async () => {