|
|
@@ -60,7 +60,8 @@ describe('TmuxMultiplexer', () => {
|
|
|
logMock.mockClear();
|
|
|
crossSpawnMock.mockReset();
|
|
|
crossSpawnMock.mockImplementation((command: string[]) => {
|
|
|
- if (command[0] === 'which') return createSpawnResult(0, '/usr/bin/tmux\n');
|
|
|
+ if (command[0] === 'which')
|
|
|
+ return createSpawnResult(0, '/usr/bin/tmux\n');
|
|
|
if (command[1] === '-V') return createSpawnResult(0, 'tmux 3.6a');
|
|
|
if (command[1] === 'split-window') {
|
|
|
return createSpawnResult(0, '%2\n');
|
|
|
@@ -78,8 +79,18 @@ describe('TmuxMultiplexer', () => {
|
|
|
const { TmuxMultiplexer } = await importFreshTmux();
|
|
|
const tmux = new TmuxMultiplexer('main-vertical', 60);
|
|
|
|
|
|
- await tmux.spawnPane('session-1', 'First worker', 'http://localhost:4096', '/repo');
|
|
|
- await tmux.spawnPane('session-2', 'Second worker', 'http://localhost:4096', '/repo');
|
|
|
+ await tmux.spawnPane(
|
|
|
+ 'session-1',
|
|
|
+ 'First worker',
|
|
|
+ 'http://localhost:4096',
|
|
|
+ '/repo',
|
|
|
+ );
|
|
|
+ await tmux.spawnPane(
|
|
|
+ 'session-2',
|
|
|
+ 'Second worker',
|
|
|
+ 'http://localhost:4096',
|
|
|
+ '/repo',
|
|
|
+ );
|
|
|
|
|
|
expect(
|
|
|
commands().filter((command) => command.includes('select-layout')),
|
|
|
@@ -105,7 +116,8 @@ describe('TmuxMultiplexer', () => {
|
|
|
const tmux = new TmuxMultiplexer('main-vertical', 60);
|
|
|
|
|
|
crossSpawnMock.mockImplementation((command: string[]) => {
|
|
|
- if (command[0] === 'which') return createSpawnResult(0, '/usr/bin/tmux\n');
|
|
|
+ if (command[0] === 'which')
|
|
|
+ return createSpawnResult(0, '/usr/bin/tmux\n');
|
|
|
if (command[1] === '-V') return createSpawnResult(0, 'tmux 3.6a');
|
|
|
if (command.includes('select-layout')) {
|
|
|
return createSpawnResult(1, '', 'layout failed');
|
|
|
@@ -134,7 +146,12 @@ describe('TmuxMultiplexer', () => {
|
|
|
const { TmuxMultiplexer } = await importFreshTmux();
|
|
|
const tmux = new TmuxMultiplexer('main-vertical', 60);
|
|
|
|
|
|
- await tmux.spawnPane('session-1', 'First worker', 'http://localhost:4096', '/repo');
|
|
|
+ await tmux.spawnPane(
|
|
|
+ 'session-1',
|
|
|
+ 'First worker',
|
|
|
+ 'http://localhost:4096',
|
|
|
+ '/repo',
|
|
|
+ );
|
|
|
await tmux.applyLayout('tiled', 60);
|
|
|
await wait(300);
|
|
|
|