mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
* 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 --------- Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
22 lines
573 B
TypeScript
22 lines
573 B
TypeScript
import { beforeAll, afterAll } from 'vitest'
|
|
|
|
const originalEnv: Record<string, string | undefined> = {}
|
|
|
|
beforeAll(() => {
|
|
originalEnv.NODE_ENV = process.env.NODE_ENV
|
|
originalEnv.PORT = process.env.PORT
|
|
originalEnv.DATABASE_PATH = process.env.DATABASE_PATH
|
|
originalEnv.AUTH_SECRET = process.env.AUTH_SECRET
|
|
originalEnv.WORKSPACE_PATH = process.env.WORKSPACE_PATH
|
|
})
|
|
|
|
afterAll(() => {
|
|
for (const [key, value] of Object.entries(originalEnv)) {
|
|
if (value === undefined) {
|
|
delete process.env[key]
|
|
} else {
|
|
process.env[key] = value
|
|
}
|
|
}
|
|
})
|