fix: improve Windows tunnel support

This commit is contained in:
Bohdan Triapitsyn
2026-06-05 15:01:22 +03:00
parent e823497cf1
commit 16fdff530b
24 changed files with 936 additions and 151 deletions
@@ -0,0 +1,31 @@
import { describe, expect, it } from 'bun:test';
import { getTunnelDependencyInstallInfo } from './install-help.js';
import {
TUNNEL_PROVIDER_CLOUDFLARE,
TUNNEL_PROVIDER_NGROK,
} from './types.js';
describe('getTunnelDependencyInstallInfo', () => {
it('returns Windows cloudflared winget guidance', () => {
const info = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_CLOUDFLARE, 'win32');
expect(info.dependency).toBe('cloudflared');
expect(info.installCommand).toBe('winget install --id Cloudflare.cloudflared');
expect(info.message).toContain('Cloudflare.cloudflared');
});
it('returns Windows ngrok winget guidance', () => {
const info = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_NGROK, 'win32');
expect(info.dependency).toBe('ngrok');
expect(info.installCommand).toBe('winget install ngrok -s msstore');
expect(info.message).toContain('ngrok -s msstore');
});
it('keeps macOS Homebrew guidance', () => {
const info = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_CLOUDFLARE, 'darwin');
expect(info.installCommand).toBe('brew install cloudflared');
});
});