forked from CodebuffAI/codebuff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting-env-process.ts
More file actions
78 lines (68 loc) · 1.84 KB
/
Copy pathtesting-env-process.ts
File metadata and controls
78 lines (68 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import type { BaseEnv, ProcessEnv } from './types/contracts/env'
/**
* Test-only helpers for process env snapshots.
* Keep production code using `@codebuff/common/env-process`.
*/
export const createTestBaseEnv = (
overrides: Partial<BaseEnv> = {},
): BaseEnv => ({
SHELL: undefined,
COMSPEC: undefined,
HOME: '/home/test',
USERPROFILE: undefined,
APPDATA: undefined,
XDG_CONFIG_HOME: undefined,
TERM: 'xterm-256color',
TERM_PROGRAM: undefined,
TERM_BACKGROUND: undefined,
TERMINAL_EMULATOR: undefined,
COLORFGBG: undefined,
NODE_ENV: 'test',
NODE_PATH: undefined,
PATH: '/usr/bin',
...overrides,
})
export const createTestProcessEnv = (
overrides: Partial<ProcessEnv> = {},
): ProcessEnv => ({
...createTestBaseEnv(),
// Terminal-specific
KITTY_WINDOW_ID: undefined,
SIXEL_SUPPORT: undefined,
ZED_NODE_ENV: undefined,
// VS Code family detection
VSCODE_THEME_KIND: undefined,
VSCODE_COLOR_THEME_KIND: undefined,
VSCODE_GIT_IPC_HANDLE: undefined,
VSCODE_PID: undefined,
VSCODE_CWD: undefined,
VSCODE_NLS_CONFIG: undefined,
// Cursor editor detection
CURSOR_PORT: undefined,
CURSOR: undefined,
// JetBrains IDE detection
JETBRAINS_REMOTE_RUN: undefined,
IDEA_INITIAL_DIRECTORY: undefined,
IDE_CONFIG_DIR: undefined,
JB_IDE_CONFIG_DIR: undefined,
// Editor preferences
VISUAL: undefined,
EDITOR: undefined,
CODEBUFF_CLI_EDITOR: undefined,
CODEBUFF_EDITOR: undefined,
// Theme preferences
OPEN_TUI_THEME: undefined,
OPENTUI_THEME: undefined,
// Codebuff CLI-specific
CODEBUFF_IS_BINARY: undefined,
CODEBUFF_CLI_VERSION: undefined,
CODEBUFF_CLI_TARGET: undefined,
CODEBUFF_RG_PATH: undefined,
CODEBUFF_WASM_DIR: undefined,
// Build/CI flags
VERBOSE: undefined,
OVERRIDE_TARGET: undefined,
OVERRIDE_PLATFORM: undefined,
OVERRIDE_ARCH: undefined,
...overrides,
})