mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Isolate test state and inject the restart-pending check into config routes
This commit is contained in:
1 parent
26fd21250a
commit
76ca65ec5e
10 files changed
+39
-37
No files matched your search
@@ -6,13 +6,16 @@ import type { Database } from 'bun:sqlite'
|
||||
import { createRepo } from '../../../src/db/queries'
|
||||
import { createGitService, type GitService } from '../../../src/services/git/GitService'
|
||||
import type { Repo } from '../../../src/types/repo'
|
||||
import { applyTestEnv } from '../../helpers/test-env'
|
||||
import { createTestDatabase } from '../../helpers/test-database'
|
||||
import { cloneOrigin, createCommittedRepo, createGitAuthService, createOrigin, git, uniqueName } from '../../helpers/git-fixtures'
|
||||
|
||||
const workspaceRoot = mkdtempSync(path.join(tmpdir(), 'git-service-'))
|
||||
process.env.WORKSPACE_PATH = workspaceRoot
|
||||
process.env.GIT_CONFIG_NOSYSTEM = '1'
|
||||
process.env.GIT_CONFIG_GLOBAL = '/dev/null'
|
||||
const restoreEnv = applyTestEnv({
|
||||
WORKSPACE_PATH: workspaceRoot,
|
||||
GIT_CONFIG_NOSYSTEM: '1',
|
||||
GIT_CONFIG_GLOBAL: '/dev/null',
|
||||
})
|
||||
|
||||
const reposPath = path.join(workspaceRoot, 'repos')
|
||||
|
||||
@@ -37,6 +40,7 @@ describe('GitService', () => {
|
||||
})
|
||||
|
||||
afterAll(() => {
|
||||
restoreEnv()
|
||||
rmSync(workspaceRoot, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user