feat: add provider-aware browser QA setup

Detect host-native browser tools before offering the isolated local Chromium fallback, add a common readiness fixture, harden managed browser startup, and verify standards installs expose one canonical QA skill.
This commit is contained in:
Sinabina
2026-07-20 16:01:24 -07:00
parent f14445bb00
commit d6ef673e4d
163 changed files with 5272 additions and 990 deletions
+29
View File
@@ -227,6 +227,35 @@ describe('resolveNodeServerScript', () => {
});
});
describe('resolveServerLaunchTarget', () => {
const { resolveServerLaunchTarget } = require('../src/cli');
test('compiled clients select adjacent server-node.mjs without requiring source server.ts', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'browse-compiled-launch-'));
const distDir = path.join(root, 'browse', 'dist');
fs.mkdirSync(distDir, { recursive: true });
const executable = path.join(distDir, 'browse');
const nodeServer = path.join(distDir, 'server-node.mjs');
fs.writeFileSync(executable, 'fixture');
fs.writeFileSync(nodeServer, 'fixture');
try {
expect(resolveServerLaunchTarget({}, '/$bunfs/root', executable)).toEqual({
isCompiled: true,
nodeServerScript: nodeServer,
sourceServerScript: null,
});
expect(fs.existsSync(path.join(root, 'browse', 'src', 'server.ts'))).toBe(false);
} finally {
fs.rmSync(root, { recursive: true, force: true });
}
});
test('compiled clients fail with the managed-runtime remedy when the Node daemon is absent', () => {
expect(() => resolveServerLaunchTarget({}, '/$bunfs/root', '/nonexistent/browse'))
.toThrow('server-node.mjs not found');
});
});
describe('version mismatch detection', () => {
test('detects when versions differ', () => {
const stateVersion = 'abc123';