Test fix branch (#157)

* fix(lsp): Fixes pyright LSP initialization timeout

* test(lsp): Add unit tests for bin directory initialization

- Add reinitializeBinDirectory() public method for testing
- Add 7 comprehensive test cases
- Cover success scenarios, error handling, and edge cases
- Achieve 100% code and branch coverage

* Refactor OpenCode server for testability and fix bin directory tests

* Standardize test ENV mocks and modernize imports

---------

Co-authored-by: Niu Shuai <guisu2010@gmail.com>
This commit is contained in:
Chris ScottandNiu Shuai authored and GitHub committed 2026-03-08 21:40:37 -04:00
1 parent 62343366f6
commit 5746033fde
5 files changed
+131 -48

No files matched your search

+4 -4
View File
@@ -1,8 +1,8 @@
/* eslint-disable no-empty */
import { promises as fs } from 'fs'
import { execFile } from 'child_process'
import { randomBytes } from 'crypto'
import { join } from 'path'
import fs from 'node:fs/promises'
import { execFile } from 'node:child_process'
import { randomBytes } from 'node:crypto'
import { join } from 'node:path'
import { getWorkspacePath } from '@opencode-manager/shared/config/env'
const SSH_KEYS_DIR = join(getWorkspacePath(), '.ssh-keys')