test(sdk): enforce runtime bridge seam and explicit no-fallback behavior

This commit is contained in:
Tom Boucher
2026-05-05 19:31:03 -04:00
parent 54b06e653e
commit 00ba404b60
3 changed files with 57 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import { describe, it, expect, vi } from 'vitest';
import { createGSDToolsRuntime } from './query-gsd-tools-runtime.js';
describe('SDK Runtime Bridge seam coverage', () => {
it('exposes bridge as the single runtime seam', () => {
const runtime = createGSDToolsRuntime({
projectDir: '/tmp/project',
gsdToolsPath: '/tmp/gsd-tools.cjs',
timeoutMs: 1_000,
shouldUseNativeQuery: () => true,
execJsonFallback: vi.fn(async () => ({})),
execRawFallback: vi.fn(async () => ''),
});
expect(Object.keys(runtime)).toEqual(['bridge']);
expect(typeof runtime.bridge.resolve).toBe('function');
expect(typeof runtime.bridge.execute).toBe('function');
expect(typeof runtime.bridge.dispatchHotpath).toBe('function');
});
});