Files
arboretum/packages/vscode/test/config.test.ts
Johan LEROY d4e3ab47cd feat(vscode): statut git détaillé, sessions archivées, lien IDE web, fetch/pull (0.2.0)
Reflète la refonte IDE en supervision légère, sans dupliquer l'éditeur :
- statut git fin dans l'arbre (staged/unstaged/conflits + dernier commit) ;
- commande « Open Worktree IDE » → deep-link /workspace/:repoId/:wt ;
- commandes fetch / pull (ff-only|rebase) sur les worktrees ;
- event WS session_archived + réglage showArchivedSessions (badge + filtre).
README/CHANGELOG + tests (config/rest-client/ws-client).
2026-06-27 16:04:28 +02:00

23 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import { normalizeBaseUrl, workspaceUrl, wsUrlFromBase } from '../src/config.js';
describe('config', () => {
it('normalise la base URL (slash final, défaut)', () => {
expect(normalizeBaseUrl('http://127.0.0.1:7317/')).toBe('http://127.0.0.1:7317');
expect(normalizeBaseUrl(' http://host:8080// ')).toBe('http://host:8080');
expect(normalizeBaseUrl('')).toBe('http://127.0.0.1:7317');
});
it('dérive lURL WebSocket (/ws, http→ws, https→wss)', () => {
expect(wsUrlFromBase('http://127.0.0.1:7317')).toBe('ws://127.0.0.1:7317/ws');
expect(wsUrlFromBase('https://box.ts.net')).toBe('wss://box.ts.net/ws');
});
it('construit lURL de la vue IDE web (workspaceUrl, encodage par segment)', () => {
expect(workspaceUrl('http://127.0.0.1:7317', 'repo id', '/home/user/wt')).toBe(
'http://127.0.0.1:7317/workspace/repo%20id/%2Fhome%2Fuser%2Fwt',
);
expect(workspaceUrl('https://box.ts.net/', 'r', '/a/b')).toBe('https://box.ts.net/workspace/r/%2Fa%2Fb');
});
});