Files
gstack/browse/test/find-browse.test.ts
Garry Tan cb11783253 refactor: remove version check from find-browse, simplify to binary locator
Delete checkVersion(), readCache(), writeCache(), fetchRemoteSHA(),
resolveSkillDir(), CacheEntry interface, REPO_URL/CACHE_PATH/CACHE_TTL
constants, and META output from find-browse.ts.

Version checking is now handled by bin/gstack-update-check (previous commit).
2026-03-13 23:57:13 -05:00

25 lines
782 B
TypeScript

/**
* Tests for find-browse binary locator.
*/
import { describe, test, expect } from 'bun:test';
import { locateBinary } from '../src/find-browse';
import { existsSync } from 'fs';
describe('locateBinary', () => {
test('returns null when no binary exists at known paths', () => {
// This test depends on the test environment — if a real binary exists at
// ~/.claude/skills/gstack/browse/dist/browse, it will find it.
// We mainly test that the function doesn't throw.
const result = locateBinary();
expect(result === null || typeof result === 'string').toBe(true);
});
test('returns string path when binary exists', () => {
const result = locateBinary();
if (result !== null) {
expect(existsSync(result)).toBe(true);
}
});
});