mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-19 02:42:29 +08:00
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).
25 lines
782 B
TypeScript
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);
|
|
}
|
|
});
|
|
});
|