@golba98/codexa 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +391 -94
- package/package.json +12 -7
- package/src/app.tsx +149 -117
- package/src/commands/handler.ts +4 -4
- package/src/config/buildInfo.ts +2 -2
- package/src/config/persistence.ts +10 -0
- package/src/config/settings.ts +7 -15
- package/src/config/updateCheckCache.ts +19 -1
- package/src/core/channel.ts +23 -0
- package/src/core/executables/codexExecutable.ts +1 -0
- package/src/core/executables/executableResolver.ts +61 -43
- package/src/core/launchContext.ts +33 -33
- package/src/core/process/processValidation.ts +9 -5
- package/src/core/providerLauncher/launcher.ts +59 -42
- package/src/core/updateCheck.ts +111 -95
- package/src/session/types.ts +2 -1
- package/src/ui/ActionRequiredBlock.tsx +5 -5
- package/src/ui/ActivityBars.tsx +3 -3
- package/src/ui/ActivityIndicator.tsx +6 -6
- package/src/ui/AgentBlock.tsx +6 -6
- package/src/ui/AnimatedStatusText.tsx +1 -1
- package/src/ui/AppShell.tsx +9 -24
- package/src/ui/AttachmentImportPanel.tsx +8 -8
- package/src/ui/AuthPanel.tsx +20 -20
- package/src/ui/BottomComposer.tsx +117 -78
- package/src/ui/DashCard.tsx +3 -3
- package/src/ui/Markdown.tsx +17 -17
- package/src/ui/ModelPickerScreen.tsx +10 -10
- package/src/ui/ModelReasoningPicker.tsx +14 -14
- package/src/ui/Panel.tsx +3 -3
- package/src/ui/PlanActionPicker.tsx +6 -6
- package/src/ui/PlanReviewPanel.tsx +8 -8
- package/src/ui/ProviderPicker.tsx +18 -18
- package/src/ui/RunFooter.tsx +3 -3
- package/src/ui/SelectionPanel.tsx +4 -4
- package/src/ui/SettingsPanel.tsx +8 -8
- package/src/ui/Spinner.tsx +1 -1
- package/src/ui/TextEntryPanel.tsx +10 -10
- package/src/ui/ThinkingBlock.tsx +8 -8
- package/src/ui/Timeline.tsx +21 -17
- package/src/ui/TopHeader.tsx +421 -293
- package/src/ui/TurnGroup.tsx +31 -31
- package/src/ui/UpdateAvailableCard.tsx +41 -0
- package/src/ui/UpdatePromptPanel.tsx +203 -0
- package/src/ui/focus.ts +3 -0
- package/src/ui/layout.ts +1 -1
- package/src/ui/logoVariants.ts +107 -0
- package/src/ui/modeDisplay.ts +12 -12
- package/src/ui/runtimeDisplay.ts +100 -0
- package/src/ui/theme.tsx +274 -395
- package/src/ui/timelineMeasure.ts +29 -19
- package/scripts/audit-codexa-capabilities.mjs +0 -466
- package/scripts/gen-build-info.mjs +0 -33
- package/scripts/smoke-terminal-bench.mjs +0 -35
- package/src/appRenderStability.test.ts +0 -131
- package/src/commands/handler.test.ts +0 -655
- package/src/config/launchArgs.test.ts +0 -189
- package/src/config/layeredConfig.test.ts +0 -143
- package/src/config/persistence.test.ts +0 -114
- package/src/config/runtimeConfig.test.ts +0 -218
- package/src/config/settings.test.ts +0 -155
- package/src/config/trustStore.test.ts +0 -29
- package/src/core/attachments.test.ts +0 -155
- package/src/core/auth/codexAuth.test.ts +0 -68
- package/src/core/cleanupFastFail.test.ts +0 -76
- package/src/core/codexExecArgs.test.ts +0 -195
- package/src/core/codexLaunch.test.ts +0 -205
- package/src/core/codexPrompt.test.ts +0 -252
- package/src/core/executables/codexExecutable.test.ts +0 -212
- package/src/core/executables/executableResolver.test.ts +0 -129
- package/src/core/executables/geminiExecutable.test.ts +0 -116
- package/src/core/executables/pathSanityScan.test.ts +0 -47
- package/src/core/githubDiagnostics.test.ts +0 -92
- package/src/core/hollowResponseFormat.test.ts +0 -58
- package/src/core/launchContext.test.ts +0 -157
- package/src/core/models/codexCapabilities.test.ts +0 -45
- package/src/core/models/codexModelCapabilities.test.ts +0 -246
- package/src/core/models/modelSpecs.test.ts +0 -283
- package/src/core/perf/renderDebug.test.ts +0 -230
- package/src/core/planStorage.test.ts +0 -143
- package/src/core/process/CommandRunner.test.ts +0 -105
- package/src/core/projectInstructions.test.ts +0 -50
- package/src/core/providerLauncher/launcher.test.ts +0 -238
- package/src/core/providerLauncher/registry.test.ts +0 -324
- package/src/core/providerLauncher/workspaceConfig.test.ts +0 -638
- package/src/core/providerRuntime/anthropic.test.ts +0 -1120
- package/src/core/providerRuntime/capabilityProfile.test.ts +0 -311
- package/src/core/providerRuntime/contextMetadata.test.ts +0 -468
- package/src/core/providerRuntime/gemini.test.ts +0 -437
- package/src/core/providerRuntime/lmstudio.test.ts +0 -168
- package/src/core/providerRuntime/local.test.ts +0 -787
- package/src/core/providerRuntime/registry.test.ts +0 -233
- package/src/core/providers/codexJsonStream.test.ts +0 -148
- package/src/core/providers/codexSubprocess.test.ts +0 -68
- package/src/core/providers/codexTranscript.test.ts +0 -284
- package/src/core/terminal/startupClear.test.ts +0 -55
- package/src/core/terminal/terminalCapabilities.test.ts +0 -93
- package/src/core/terminal/terminalControl.test.ts +0 -75
- package/src/core/terminal/terminalSanitize.test.ts +0 -22
- package/src/core/terminal/terminalSelection.test.ts +0 -42
- package/src/core/terminal/terminalTitle.test.ts +0 -328
- package/src/core/updateCheck.test.ts +0 -194
- package/src/core/workspaceActivity.test.ts +0 -163
- package/src/core/workspaceGuard.test.ts +0 -151
- package/src/core/workspaceRoot.test.ts +0 -23
- package/src/exec.test.ts +0 -13
- package/src/headless/execArgs.test.ts +0 -147
- package/src/headless/execRunner.test.ts +0 -436
- package/src/index.test.tsx +0 -620
- package/src/session/appSession.test.ts +0 -897
- package/src/session/chatLifecycle.test.ts +0 -64
- package/src/session/liveRenderScheduler.test.ts +0 -201
- package/src/session/planFlow.test.ts +0 -103
- package/src/session/planTranscript.test.ts +0 -65
- package/src/session/promptRunSchedule.test.ts +0 -36
- package/src/ui/ActivityIndicator.test.tsx +0 -58
- package/src/ui/AgentBlock.test.ts +0 -6
- package/src/ui/AnimatedStatusText.test.ts +0 -16
- package/src/ui/AppShell.test.tsx +0 -1776
- package/src/ui/AttachmentImportPanel.test.tsx +0 -204
- package/src/ui/BottomComposer.test.ts +0 -674
- package/src/ui/CodexLogo.tsx +0 -55
- package/src/ui/Markdown.test.ts +0 -157
- package/src/ui/ModelPickerProviderScope.test.tsx +0 -411
- package/src/ui/ModelPickerScreen.test.tsx +0 -99
- package/src/ui/ModelPickerState.test.tsx +0 -151
- package/src/ui/ModelReasoningPicker.test.tsx +0 -447
- package/src/ui/PlanReviewPanel.test.tsx +0 -267
- package/src/ui/PromptCardBorder.test.tsx +0 -161
- package/src/ui/ProviderPicker.test.tsx +0 -289
- package/src/ui/ProviderShortcut.test.tsx +0 -143
- package/src/ui/SettingsPanel.test.tsx +0 -233
- package/src/ui/Timeline.test.ts +0 -2067
- package/src/ui/TimelineNavigation.test.tsx +0 -201
- package/src/ui/TopHeader.test.tsx +0 -254
- package/src/ui/TurnGroup.test.tsx +0 -365
- package/src/ui/busyStatusAnimation.test.ts +0 -30
- package/src/ui/commandNormalize.test.ts +0 -142
- package/src/ui/diffRenderer.test.ts +0 -102
- package/src/ui/focusFlow.test.tsx +0 -1098
- package/src/ui/inputBuffer.test.ts +0 -151
- package/src/ui/layout.test.ts +0 -146
- package/src/ui/modeDisplay.test.ts +0 -42
- package/src/ui/runActivityView.test.ts +0 -89
- package/src/ui/runLifecycleView.test.tsx +0 -237
- package/src/ui/statusRenderIsolation.test.tsx +0 -654
- package/src/ui/terminalAnswerFormat.test.ts +0 -19
- package/src/ui/textLayout.test.ts +0 -18
- package/src/ui/themeFlow.test.ts +0 -53
- package/src/ui/timelineMeasureCache.test.ts +0 -986
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
acquireTerminalTitleGuard,
|
|
5
|
-
buildTerminalTitleSequence,
|
|
6
|
-
computeTerminalTitle,
|
|
7
|
-
deriveTerminalTitle,
|
|
8
|
-
formatTerminalTitleLabel,
|
|
9
|
-
getIntendedTerminalTitle,
|
|
10
|
-
normalizeTerminalTitle,
|
|
11
|
-
reassertTerminalTitle,
|
|
12
|
-
reassertIntendedTerminalTitle,
|
|
13
|
-
sanitizeTerminalTitle,
|
|
14
|
-
setIntendedTerminalTitle,
|
|
15
|
-
setTerminalTitle,
|
|
16
|
-
startTerminalTitleStartupGuard,
|
|
17
|
-
beginColdStartSequence,
|
|
18
|
-
createTerminalTitleSequenceStripper,
|
|
19
|
-
stripTerminalTitleSequences,
|
|
20
|
-
stripTerminalTitleSequencesFromChunk,
|
|
21
|
-
traceTerminalTitleSequences,
|
|
22
|
-
writeCodexaTerminalTitle,
|
|
23
|
-
writeGuardedTerminalOutput,
|
|
24
|
-
__resetTerminalTitleCache,
|
|
25
|
-
} from "./terminalTitle.js";
|
|
26
|
-
|
|
27
|
-
function sleep(ms: number): Promise<void> {
|
|
28
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
test("buildTerminalTitleSequence emits OSC 0 and OSC 2 with sanitized title text", () => {
|
|
32
|
-
const sequence = buildTerminalTitleSequence("Codexa\u0007!");
|
|
33
|
-
assert.equal(sequence, "\x1b]0;Codexa !\x07\x1b]2;Codexa !\x07");
|
|
34
|
-
assert.equal(sanitizeTerminalTitle(" Codexa "), "Codexa");
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test("title normalization never exposes raw Windows paths", () => {
|
|
38
|
-
assert.equal(normalizeTerminalTitle("C:\\WINDOWS\\system"), "Codexa");
|
|
39
|
-
assert.equal(normalizeTerminalTitle("c:/Users/example"), "Codexa");
|
|
40
|
-
assert.equal(normalizeTerminalTitle("\\\\server\\share"), "Codexa");
|
|
41
|
-
assert.equal(buildTerminalTitleSequence("C:\\WINDOWS\\system"), buildTerminalTitleSequence("Codexa"));
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
test("stripTerminalTitleSequences removes OSC 0 title sequences with BEL terminator", () => {
|
|
45
|
-
assert.equal(
|
|
46
|
-
stripTerminalTitleSequences("hello\x1b]0;C:\\WINDOWS\\system\x07world"),
|
|
47
|
-
"helloworld",
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("stripTerminalTitleSequences removes OSC 2 title sequences with BEL terminator", () => {
|
|
52
|
-
assert.equal(
|
|
53
|
-
stripTerminalTitleSequences("hello\x1b]2;Codex\x07world"),
|
|
54
|
-
"helloworld",
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test("stripTerminalTitleSequences preserves normal ANSI SGR colour sequences", () => {
|
|
59
|
-
const input = "\x1b[31mred\x1b[0m";
|
|
60
|
-
assert.equal(stripTerminalTitleSequences(input), input);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test("stripTerminalTitleSequences removes title OSC from mixed output while preserving SGR", () => {
|
|
64
|
-
assert.equal(
|
|
65
|
-
stripTerminalTitleSequences("start\x1b]0;C:\\WINDOWS\\system\x07middle\x1b[32mok\x1b[0mend"),
|
|
66
|
-
"startmiddle\x1b[32mok\x1b[0mend",
|
|
67
|
-
);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("stripTerminalTitleSequences removes OSC title sequences with ST terminator", () => {
|
|
71
|
-
assert.equal(
|
|
72
|
-
stripTerminalTitleSequences("hello\x1b]0;C:\\WINDOWS\\system\x1b\\world"),
|
|
73
|
-
"helloworld",
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test("stripTerminalTitleSequencesFromChunk handles Buffer input", () => {
|
|
78
|
-
assert.equal(
|
|
79
|
-
stripTerminalTitleSequencesFromChunk(Buffer.from("hello\x1b]0;C:\\WINDOWS\\system\x07world", "utf8")),
|
|
80
|
-
"helloworld",
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test("createTerminalTitleSequenceStripper removes title sequences split across chunks", () => {
|
|
85
|
-
const stripper = createTerminalTitleSequenceStripper({
|
|
86
|
-
source: "test",
|
|
87
|
-
stream: "stdout",
|
|
88
|
-
origin: "child",
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
assert.equal(stripper.process("hello\x1b]0;C:\\WINDOWS"), "hello");
|
|
92
|
-
assert.equal(stripper.process("\\system\x07world"), "world");
|
|
93
|
-
assert.equal(stripper.flush(), "");
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
test("formatTerminalTitleLabel follows the workspace leaf and app-name rules", () => {
|
|
97
|
-
assert.equal(
|
|
98
|
-
formatTerminalTitleLabel("C:\\Development\\1-JavaScript\\13-Custom-CLI-Normal", "dir"),
|
|
99
|
-
"13-Custom-CLI-Normal",
|
|
100
|
-
);
|
|
101
|
-
assert.equal(
|
|
102
|
-
formatTerminalTitleLabel("C:\\Development\\1-JavaScript\\13-Custom-CLI-Normal", "name"),
|
|
103
|
-
"Codexa",
|
|
104
|
-
);
|
|
105
|
-
assert.equal(
|
|
106
|
-
formatTerminalTitleLabel("C:\\Development\\1-JavaScript\\13-Custom-CLI-Normal", "simple"),
|
|
107
|
-
"Codexa",
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
test("deriveTerminalTitle follows terminal title mode on startup", () => {
|
|
112
|
-
const workspaceRoot = "C:\\Development\\1-JavaScript\\13-Custom-CLI-Normal";
|
|
113
|
-
|
|
114
|
-
assert.equal(deriveTerminalTitle(workspaceRoot, "dir"), "13-Custom-CLI-Normal");
|
|
115
|
-
assert.equal(deriveTerminalTitle(workspaceRoot, "name"), "Codexa");
|
|
116
|
-
assert.equal(deriveTerminalTitle(workspaceRoot, "simple"), "Codexa");
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test("computeTerminalTitle follows the requested mapping", () => {
|
|
120
|
-
const workspaceName = "13-Custom-CLI-Normal";
|
|
121
|
-
assert.equal(computeTerminalTitle({ terminalTitleMode: "dir", workspaceName }), "13-Custom-CLI-Normal");
|
|
122
|
-
assert.equal(computeTerminalTitle({ terminalTitleMode: "name" }), "Codexa");
|
|
123
|
-
assert.equal(computeTerminalTitle({ terminalTitleMode: "simple" }), "Codexa");
|
|
124
|
-
assert.equal(computeTerminalTitle({ terminalTitleMode: "dir", appName: "Other" }), "Other");
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
test("reassertTerminalTitle writes both title sequences without mutating process title", () => {
|
|
128
|
-
const writes: string[] = [];
|
|
129
|
-
const originalTitle = process.title;
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
reassertTerminalTitle("Codexa", (chunk) => {
|
|
133
|
-
writes.push(chunk);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
assert.equal(process.title, originalTitle);
|
|
137
|
-
assert.deepEqual(writes, [buildTerminalTitleSequence("Codexa")]);
|
|
138
|
-
} finally {
|
|
139
|
-
process.title = originalTitle;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
test("acquireTerminalTitleGuard asserts immediately, ticks while active, and reasserts on release", async () => {
|
|
144
|
-
let calls = 0;
|
|
145
|
-
const release = acquireTerminalTitleGuard(10, () => {
|
|
146
|
-
calls += 1;
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
await sleep(35);
|
|
150
|
-
release();
|
|
151
|
-
|
|
152
|
-
const callsAfterRelease = calls;
|
|
153
|
-
await sleep(20);
|
|
154
|
-
|
|
155
|
-
assert.ok(callsAfterRelease >= 3, `expected at least 3 title assertions, got ${callsAfterRelease}`);
|
|
156
|
-
assert.equal(calls, callsAfterRelease);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
test("acquireTerminalTitleGuard release is idempotent", () => {
|
|
160
|
-
let calls = 0;
|
|
161
|
-
const release = acquireTerminalTitleGuard(50, () => {
|
|
162
|
-
calls += 1;
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
release();
|
|
166
|
-
const callsAfterFirstRelease = calls;
|
|
167
|
-
release();
|
|
168
|
-
|
|
169
|
-
assert.equal(callsAfterFirstRelease, 2);
|
|
170
|
-
assert.equal(calls, callsAfterFirstRelease);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
test("setTerminalTitle deduplicates identical title writes", () => {
|
|
174
|
-
const writes: string[] = [];
|
|
175
|
-
__resetTerminalTitleCache();
|
|
176
|
-
|
|
177
|
-
setTerminalTitle("Codexa", { write: (chunk) => writes.push(chunk) });
|
|
178
|
-
setTerminalTitle("Codexa", { write: (chunk) => writes.push(chunk) });
|
|
179
|
-
setTerminalTitle("Other", { write: (chunk) => writes.push(chunk) });
|
|
180
|
-
|
|
181
|
-
assert.equal(writes.length, 2);
|
|
182
|
-
assert.equal(writes[0], buildTerminalTitleSequence("Codexa"));
|
|
183
|
-
assert.equal(writes[1], buildTerminalTitleSequence("Other"));
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
test("writeCodexaTerminalTitle delegates to central title writer with force support", () => {
|
|
187
|
-
const writes: string[] = [];
|
|
188
|
-
__resetTerminalTitleCache();
|
|
189
|
-
|
|
190
|
-
writeCodexaTerminalTitle("Codexa", { force: true, reason: "test", write: (chunk) => writes.push(chunk) });
|
|
191
|
-
|
|
192
|
-
assert.deepEqual(writes, [buildTerminalTitleSequence("Codexa")]);
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
test("intended terminal title fallback is safe and later replaced by workspace title", () => {
|
|
196
|
-
const writes: string[] = [];
|
|
197
|
-
__resetTerminalTitleCache();
|
|
198
|
-
|
|
199
|
-
setIntendedTerminalTitle("C:\\WINDOWS\\system", {
|
|
200
|
-
force: true,
|
|
201
|
-
reason: "test-fallback",
|
|
202
|
-
write: (chunk) => writes.push(chunk),
|
|
203
|
-
});
|
|
204
|
-
assert.equal(getIntendedTerminalTitle(), "Codexa");
|
|
205
|
-
assert.equal(writes.at(-1), buildTerminalTitleSequence("Codexa"));
|
|
206
|
-
|
|
207
|
-
setIntendedTerminalTitle("13-Custom-CLI-Normal", {
|
|
208
|
-
force: true,
|
|
209
|
-
reason: "test-workspace",
|
|
210
|
-
write: (chunk) => writes.push(chunk),
|
|
211
|
-
});
|
|
212
|
-
assert.equal(getIntendedTerminalTitle(), "13-Custom-CLI-Normal");
|
|
213
|
-
assert.equal(writes.at(-1), buildTerminalTitleSequence("13-Custom-CLI-Normal"));
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test("busy idle reassertion keeps the same intended title", () => {
|
|
217
|
-
const writes: string[] = [];
|
|
218
|
-
__resetTerminalTitleCache();
|
|
219
|
-
|
|
220
|
-
setIntendedTerminalTitle("13-Custom-CLI-Normal", {
|
|
221
|
-
force: true,
|
|
222
|
-
write: (chunk) => writes.push(chunk),
|
|
223
|
-
});
|
|
224
|
-
reassertIntendedTerminalTitle({ reason: "busy-start", write: (chunk) => writes.push(chunk) });
|
|
225
|
-
reassertIntendedTerminalTitle({ reason: "busy-end", write: (chunk) => writes.push(chunk) });
|
|
226
|
-
|
|
227
|
-
assert.equal(getIntendedTerminalTitle(), "13-Custom-CLI-Normal");
|
|
228
|
-
assert.deepEqual(writes, [
|
|
229
|
-
buildTerminalTitleSequence("13-Custom-CLI-Normal"),
|
|
230
|
-
buildTerminalTitleSequence("13-Custom-CLI-Normal"),
|
|
231
|
-
buildTerminalTitleSequence("13-Custom-CLI-Normal"),
|
|
232
|
-
]);
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
test("writeGuardedTerminalOutput strips external title OSC and preserves SGR", () => {
|
|
236
|
-
const writes: string[] = [];
|
|
237
|
-
const result = writeGuardedTerminalOutput(
|
|
238
|
-
(chunk) => {
|
|
239
|
-
writes.push(chunk);
|
|
240
|
-
return true;
|
|
241
|
-
},
|
|
242
|
-
"start\x1b]0;C:\\WINDOWS\\system\x07middle\x1b[32mok\x1b[0mend",
|
|
243
|
-
{ source: "test", stream: "stdout", origin: "child" },
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
assert.equal(result, true);
|
|
247
|
-
assert.deepEqual(writes, ["startmiddle\x1b[32mok\x1b[0mend"]);
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
test("setTerminalTitle force option bypasses dedup", () => {
|
|
251
|
-
const writes: string[] = [];
|
|
252
|
-
__resetTerminalTitleCache();
|
|
253
|
-
|
|
254
|
-
setTerminalTitle("Codexa", { write: (chunk) => writes.push(chunk) });
|
|
255
|
-
setTerminalTitle("Codexa", { force: true, write: (chunk) => writes.push(chunk) });
|
|
256
|
-
setTerminalTitle("Codexa", { force: true, write: (chunk) => writes.push(chunk) });
|
|
257
|
-
|
|
258
|
-
assert.equal(writes.length, 3);
|
|
259
|
-
writes.forEach((w) => assert.equal(w, buildTerminalTitleSequence("Codexa")));
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
test("beginColdStartSequence writes immediately then retries", async () => {
|
|
263
|
-
const writes: string[] = [];
|
|
264
|
-
__resetTerminalTitleCache();
|
|
265
|
-
|
|
266
|
-
const cancel = beginColdStartSequence("Codexa", { write: (chunk) => writes.push(chunk) });
|
|
267
|
-
|
|
268
|
-
assert.equal(writes.length, 1, "should write immediately");
|
|
269
|
-
|
|
270
|
-
await sleep(60);
|
|
271
|
-
assert.equal(writes.length, 2, "should have retried at 50ms");
|
|
272
|
-
|
|
273
|
-
cancel();
|
|
274
|
-
await sleep(300);
|
|
275
|
-
assert.equal(writes.length, 2, "should not have retried further after cancel");
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
test("startup guard reasserts intended title until cancelled", async () => {
|
|
279
|
-
const writes: string[] = [];
|
|
280
|
-
__resetTerminalTitleCache();
|
|
281
|
-
|
|
282
|
-
setIntendedTerminalTitle("13-Custom-CLI-Normal", {
|
|
283
|
-
force: true,
|
|
284
|
-
write: (chunk) => writes.push(chunk),
|
|
285
|
-
});
|
|
286
|
-
const cancel = startTerminalTitleStartupGuard({
|
|
287
|
-
intervalMs: 10,
|
|
288
|
-
durationMs: 100,
|
|
289
|
-
write: (chunk) => writes.push(chunk),
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
await sleep(25);
|
|
293
|
-
cancel();
|
|
294
|
-
const writesAfterCancel = writes.length;
|
|
295
|
-
await sleep(25);
|
|
296
|
-
|
|
297
|
-
assert.ok(writesAfterCancel >= 3, `expected guard to reassert title, got ${writesAfterCancel} writes`);
|
|
298
|
-
assert.equal(writes.length, writesAfterCancel);
|
|
299
|
-
assert.ok(writes.every((chunk) => chunk === buildTerminalTitleSequence("13-Custom-CLI-Normal")));
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
test("stripTerminalTitleSequences handles very long unterminated OSC without hanging", () => {
|
|
303
|
-
const long = "\x1b]0;" + "A".repeat(100_000);
|
|
304
|
-
const start = Date.now();
|
|
305
|
-
const result = stripTerminalTitleSequences(long);
|
|
306
|
-
assert.ok(Date.now() - start < 100, "must complete in under 100 ms");
|
|
307
|
-
assert.ok(result.includes("\x1b]0;"), "unterminated sequence passes through unchanged");
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
test("stripTerminalTitleSequences strips OSC sequence with empty title", () => {
|
|
311
|
-
assert.equal(stripTerminalTitleSequences("pre\x1b]0;\x07post"), "prepost");
|
|
312
|
-
assert.equal(stripTerminalTitleSequences("pre\x1b]2;\x1b\\post"), "prepost");
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
test("createTerminalTitleSequenceStripper handles OSC split across chunks with ST terminator", () => {
|
|
316
|
-
const stripper = createTerminalTitleSequenceStripper({ source: "test", stream: "stdout", origin: "child" });
|
|
317
|
-
assert.equal(stripper.process("hello\x1b]2;MyTitle"), "hello");
|
|
318
|
-
assert.equal(stripper.process("\x1b\\world"), "world");
|
|
319
|
-
assert.equal(stripper.flush(), "");
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
test("traceTerminalTitleSequences does not hang on crafted adversarial input", () => {
|
|
323
|
-
const crafted = "\x1b]0;" + "X".repeat(10_000) + "\x1b]2;" + "Y".repeat(10_000);
|
|
324
|
-
const start = Date.now();
|
|
325
|
-
const found = traceTerminalTitleSequences(crafted, { source: "test", stream: "stdout", origin: "child" });
|
|
326
|
-
assert.ok(Date.now() - start < 100, "must complete in under 100 ms");
|
|
327
|
-
assert.equal(found, false, "no complete sequences in adversarial input");
|
|
328
|
-
});
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
CODEXA_NPM_REGISTRY_URL,
|
|
5
|
-
CODEXA_UPDATE_COMMAND,
|
|
6
|
-
checkForUpdates,
|
|
7
|
-
compareSemver,
|
|
8
|
-
formatUpdateInstructions,
|
|
9
|
-
isNewerVersion,
|
|
10
|
-
type NpmRegistryMetadata,
|
|
11
|
-
} from "./updateCheck.js";
|
|
12
|
-
import { isCacheValid, type UpdateCheckCache } from "../config/updateCheckCache.js";
|
|
13
|
-
|
|
14
|
-
function metadata(version: string): NpmRegistryMetadata {
|
|
15
|
-
return { "dist-tags": { latest: version } };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
test("checkForUpdates returns update-available when installed version is lower than npm latest", async () => {
|
|
19
|
-
const result = await checkForUpdates(
|
|
20
|
-
{},
|
|
21
|
-
{
|
|
22
|
-
currentVersion: "1.0.1",
|
|
23
|
-
fetchNpmMetadataFn: async (url) => {
|
|
24
|
-
assert.equal(url, CODEXA_NPM_REGISTRY_URL);
|
|
25
|
-
return metadata("1.0.2");
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
assert.equal(result.status, "update-available");
|
|
31
|
-
assert.equal(result.currentVersion, "1.0.1");
|
|
32
|
-
assert.equal(result.latestVersion, "1.0.2");
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test("checkForUpdates returns up-to-date when installed version equals npm latest", async () => {
|
|
36
|
-
const result = await checkForUpdates(
|
|
37
|
-
{},
|
|
38
|
-
{
|
|
39
|
-
currentVersion: "1.0.2",
|
|
40
|
-
fetchNpmMetadataFn: async () => metadata("1.0.2"),
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
assert.equal(result.status, "up-to-date");
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("checkForUpdates does not show update available when installed version is higher than npm latest", async () => {
|
|
48
|
-
const result = await checkForUpdates(
|
|
49
|
-
{},
|
|
50
|
-
{
|
|
51
|
-
currentVersion: "1.0.3",
|
|
52
|
-
fetchNpmMetadataFn: async () => metadata("1.0.2"),
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
assert.equal(result.status, "up-to-date");
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test("checkForUpdates returns error status instead of throwing when npm request fails", async () => {
|
|
60
|
-
const result = await checkForUpdates(
|
|
61
|
-
{},
|
|
62
|
-
{
|
|
63
|
-
currentVersion: "1.0.1",
|
|
64
|
-
fetchNpmMetadataFn: async () => {
|
|
65
|
-
throw new Error("network unavailable");
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
assert.equal(result.status, "error");
|
|
71
|
-
assert.match(result.errorMessage ?? "", /network unavailable/);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test("checkForUpdates returns error when npm latest is missing", async () => {
|
|
75
|
-
const result = await checkForUpdates(
|
|
76
|
-
{},
|
|
77
|
-
{
|
|
78
|
-
currentVersion: "1.0.1",
|
|
79
|
-
fetchNpmMetadataFn: async () => ({ "dist-tags": {} }),
|
|
80
|
-
},
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
assert.equal(result.status, "error");
|
|
84
|
-
assert.match(result.errorMessage ?? "", /dist-tags\.latest/);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("checkForUpdates returns unknown immediately when enabled=false", async () => {
|
|
88
|
-
let called = false;
|
|
89
|
-
const result = await checkForUpdates(
|
|
90
|
-
{ enabled: false },
|
|
91
|
-
{
|
|
92
|
-
currentVersion: "1.0.1",
|
|
93
|
-
fetchNpmMetadataFn: async () => {
|
|
94
|
-
called = true;
|
|
95
|
-
return metadata("1.0.2");
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
assert.equal(result.status, "unknown");
|
|
101
|
-
assert.equal(called, false, "should not call npm when disabled");
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("semver comparison handles numeric and prerelease ordering", () => {
|
|
105
|
-
assert.equal(isNewerVersion("1.0.10", "1.0.2"), true);
|
|
106
|
-
assert.equal(isNewerVersion("1.0.2", "1.0.10"), false);
|
|
107
|
-
assert.equal(compareSemver("1.0.2", "1.0.2"), 0);
|
|
108
|
-
assert.equal(isNewerVersion("1.0.2", "1.0.2-beta.1"), true);
|
|
109
|
-
assert.equal(isNewerVersion("1.0.2-beta.1", "1.0.2"), false);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
test("isCacheValid returns true when cache is within the interval", () => {
|
|
113
|
-
const cache: UpdateCheckCache = {
|
|
114
|
-
lastChecked: Date.now() - 1000 * 60 * 30,
|
|
115
|
-
currentVersion: "1.0.1",
|
|
116
|
-
latestVersion: "1.0.1",
|
|
117
|
-
updateAvailable: false,
|
|
118
|
-
};
|
|
119
|
-
assert.equal(isCacheValid(cache, 6), true);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
test("isCacheValid returns false when cache is older than the interval", () => {
|
|
123
|
-
const cache: UpdateCheckCache = {
|
|
124
|
-
lastChecked: Date.now() - 1000 * 60 * 60 * 7,
|
|
125
|
-
currentVersion: "1.0.1",
|
|
126
|
-
latestVersion: "1.0.1",
|
|
127
|
-
updateAvailable: false,
|
|
128
|
-
};
|
|
129
|
-
assert.equal(isCacheValid(cache, 6), false);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("formatUpdateInstructions formats update-available npm status", () => {
|
|
133
|
-
const result = formatUpdateInstructions({
|
|
134
|
-
status: "update-available",
|
|
135
|
-
currentVersion: "1.0.1",
|
|
136
|
-
latestVersion: "1.0.2",
|
|
137
|
-
checkedAt: Date.now(),
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
assert.match(result, /Current installed version: 1\.0\.1/);
|
|
141
|
-
assert.match(result, /npm latest version:\s+1\.0\.2/);
|
|
142
|
-
assert.match(result, /Update available: Codexa 1\.0\.2 is available\. You are using 1\.0\.1\./);
|
|
143
|
-
assert.match(result, new RegExp(`Run: ${CODEXA_UPDATE_COMMAND.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`));
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test("formatUpdateInstructions formats up-to-date npm status", () => {
|
|
147
|
-
const result = formatUpdateInstructions({
|
|
148
|
-
status: "up-to-date",
|
|
149
|
-
currentVersion: "1.0.2",
|
|
150
|
-
latestVersion: "1.0.2",
|
|
151
|
-
checkedAt: Date.now(),
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
assert.match(result, /Already up to date/);
|
|
155
|
-
assert.match(result, /npm install -g @golba98\/codexa@latest/);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
test("formatUpdateInstructions formats manual npm errors", () => {
|
|
159
|
-
const result = formatUpdateInstructions({
|
|
160
|
-
status: "error",
|
|
161
|
-
currentVersion: "1.0.1",
|
|
162
|
-
latestVersion: null,
|
|
163
|
-
errorMessage: "Connection timed out",
|
|
164
|
-
checkedAt: Date.now(),
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
assert.match(result, /Error checking npm update status: Connection timed out/);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
test("/update check path bypasses cache by performing a fresh npm check", async () => {
|
|
171
|
-
const validCache: UpdateCheckCache = {
|
|
172
|
-
lastChecked: Date.now(),
|
|
173
|
-
currentVersion: "1.0.1",
|
|
174
|
-
latestVersion: "1.0.1",
|
|
175
|
-
updateAvailable: false,
|
|
176
|
-
};
|
|
177
|
-
assert.equal(isCacheValid(validCache, 6), true);
|
|
178
|
-
|
|
179
|
-
let calls = 0;
|
|
180
|
-
const result = await checkForUpdates(
|
|
181
|
-
{ enabled: true },
|
|
182
|
-
{
|
|
183
|
-
currentVersion: validCache.currentVersion,
|
|
184
|
-
fetchNpmMetadataFn: async () => {
|
|
185
|
-
calls += 1;
|
|
186
|
-
return metadata("1.0.2");
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
assert.equal(calls, 1);
|
|
192
|
-
assert.equal(result.status, "update-available");
|
|
193
|
-
assert.equal(result.latestVersion, "1.0.2");
|
|
194
|
-
});
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtempSync, mkdirSync, rmSync, unlinkSync, writeFileSync } from "fs";
|
|
3
|
-
import { tmpdir } from "os";
|
|
4
|
-
import { join } from "path";
|
|
5
|
-
import test from "node:test";
|
|
6
|
-
import {
|
|
7
|
-
captureWorkspaceSnapshot,
|
|
8
|
-
createWorkspaceActivityTracker,
|
|
9
|
-
createTextDiffExcerpt,
|
|
10
|
-
diffWorkspaceSnapshots,
|
|
11
|
-
} from "./workspaceActivity.js";
|
|
12
|
-
|
|
13
|
-
function createTempWorkspace(): string {
|
|
14
|
-
return mkdtempSync(join(tmpdir(), "codex-workspace-activity-"));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
test("detects created files in the workspace snapshot diff", () => {
|
|
18
|
-
const root = createTempWorkspace();
|
|
19
|
-
try {
|
|
20
|
-
const before = captureWorkspaceSnapshot(root);
|
|
21
|
-
writeFileSync(join(root, "new-file.ts"), "const value = 1;\n", "utf8");
|
|
22
|
-
const after = captureWorkspaceSnapshot(root);
|
|
23
|
-
const activity = diffWorkspaceSnapshots(before, after, 123);
|
|
24
|
-
|
|
25
|
-
assert.equal(activity.length, 1);
|
|
26
|
-
assert.equal(activity[0]?.operation, "created");
|
|
27
|
-
assert.equal(activity[0]?.path, "new-file.ts");
|
|
28
|
-
assert.equal(activity[0]?.addedLines, 1);
|
|
29
|
-
} finally {
|
|
30
|
-
rmSync(root, { recursive: true, force: true });
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test("detects modified files with diff preview", () => {
|
|
35
|
-
const root = createTempWorkspace();
|
|
36
|
-
try {
|
|
37
|
-
const file = join(root, "edited.py");
|
|
38
|
-
writeFileSync(file, "print('before')\nvalue = 1\n", "utf8");
|
|
39
|
-
const before = captureWorkspaceSnapshot(root);
|
|
40
|
-
|
|
41
|
-
writeFileSync(file, "print('after')\nvalue = 2\nextra = True\n", "utf8");
|
|
42
|
-
const after = captureWorkspaceSnapshot(root);
|
|
43
|
-
const activity = diffWorkspaceSnapshots(before, after, 456);
|
|
44
|
-
|
|
45
|
-
assert.equal(activity.length, 1);
|
|
46
|
-
assert.equal(activity[0]?.operation, "modified");
|
|
47
|
-
assert.equal(activity[0]?.path, "edited.py");
|
|
48
|
-
assert.equal(activity[0]?.addedLines, 3);
|
|
49
|
-
assert.equal(activity[0]?.removedLines, 2);
|
|
50
|
-
assert.equal(activity[0]?.diffLines?.[0]?.kind, "removed");
|
|
51
|
-
assert.equal(activity[0]?.diffLines?.at(-1)?.kind, "added");
|
|
52
|
-
} finally {
|
|
53
|
-
rmSync(root, { recursive: true, force: true });
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test("detects deleted files", () => {
|
|
58
|
-
const root = createTempWorkspace();
|
|
59
|
-
try {
|
|
60
|
-
const file = join(root, "gone.txt");
|
|
61
|
-
writeFileSync(file, "goodbye\n", "utf8");
|
|
62
|
-
const before = captureWorkspaceSnapshot(root);
|
|
63
|
-
|
|
64
|
-
unlinkSync(file);
|
|
65
|
-
const after = captureWorkspaceSnapshot(root);
|
|
66
|
-
const activity = diffWorkspaceSnapshots(before, after, 789);
|
|
67
|
-
|
|
68
|
-
assert.equal(activity.length, 1);
|
|
69
|
-
assert.equal(activity[0]?.operation, "deleted");
|
|
70
|
-
assert.equal(activity[0]?.path, "gone.txt");
|
|
71
|
-
assert.equal(activity[0]?.removedLines, 1);
|
|
72
|
-
} finally {
|
|
73
|
-
rmSync(root, { recursive: true, force: true });
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test("ignores excluded directories like node_modules and .git", () => {
|
|
78
|
-
const root = createTempWorkspace();
|
|
79
|
-
try {
|
|
80
|
-
const before = captureWorkspaceSnapshot(root);
|
|
81
|
-
mkdirSync(join(root, "node_modules"), { recursive: true });
|
|
82
|
-
mkdirSync(join(root, ".git"), { recursive: true });
|
|
83
|
-
writeFileSync(join(root, "node_modules", "ignored.js"), "console.log('x')", "utf8");
|
|
84
|
-
writeFileSync(join(root, ".git", "ignored.txt"), "internal", "utf8");
|
|
85
|
-
const after = captureWorkspaceSnapshot(root);
|
|
86
|
-
const activity = diffWorkspaceSnapshots(before, after, 111);
|
|
87
|
-
|
|
88
|
-
assert.equal(activity.length, 0);
|
|
89
|
-
} finally {
|
|
90
|
-
rmSync(root, { recursive: true, force: true });
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test("workspace activity tracker can reuse a provided initial snapshot", async () => {
|
|
95
|
-
const root = createTempWorkspace();
|
|
96
|
-
try {
|
|
97
|
-
writeFileSync(join(root, "edited.txt"), "before\n", "utf8");
|
|
98
|
-
writeFileSync(join(root, "gone.txt"), "delete me\n", "utf8");
|
|
99
|
-
const before = captureWorkspaceSnapshot(root);
|
|
100
|
-
|
|
101
|
-
writeFileSync(join(root, "new-file.ts"), "const value = 1;\n", "utf8");
|
|
102
|
-
writeFileSync(join(root, "edited.txt"), "after\n", "utf8");
|
|
103
|
-
unlinkSync(join(root, "gone.txt"));
|
|
104
|
-
|
|
105
|
-
const activity = await new Promise<ReturnType<typeof diffWorkspaceSnapshots>>((resolve, reject) => {
|
|
106
|
-
let tracker: ReturnType<typeof createWorkspaceActivityTracker> | null = null;
|
|
107
|
-
const timeout = setTimeout(() => {
|
|
108
|
-
tracker?.stop();
|
|
109
|
-
reject(new Error("Timed out waiting for workspace activity."));
|
|
110
|
-
}, 500);
|
|
111
|
-
tracker = createWorkspaceActivityTracker({
|
|
112
|
-
rootDir: root,
|
|
113
|
-
initialSnapshot: before,
|
|
114
|
-
pollIntervalMs: 10,
|
|
115
|
-
onActivity: (items) => {
|
|
116
|
-
clearTimeout(timeout);
|
|
117
|
-
tracker?.stop();
|
|
118
|
-
resolve(items);
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
const operationsByPath = new Map(activity.map((item) => [item.path, item.operation]));
|
|
124
|
-
assert.equal(operationsByPath.get("new-file.ts"), "created");
|
|
125
|
-
assert.equal(operationsByPath.get("edited.txt"), "modified");
|
|
126
|
-
assert.equal(operationsByPath.get("gone.txt"), "deleted");
|
|
127
|
-
} finally {
|
|
128
|
-
rmSync(root, { recursive: true, force: true });
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("skips inline diff previews for oversized files", () => {
|
|
133
|
-
const root = createTempWorkspace();
|
|
134
|
-
try {
|
|
135
|
-
const file = join(root, "large.txt");
|
|
136
|
-
const largeContent = `${"a".repeat(129 * 1024)}\n`;
|
|
137
|
-
writeFileSync(file, largeContent, "utf8");
|
|
138
|
-
const before = captureWorkspaceSnapshot(root);
|
|
139
|
-
|
|
140
|
-
writeFileSync(file, `${largeContent}tail\n`, "utf8");
|
|
141
|
-
const after = captureWorkspaceSnapshot(root);
|
|
142
|
-
const activity = diffWorkspaceSnapshots(before, after, 222);
|
|
143
|
-
|
|
144
|
-
assert.equal(activity.length, 1);
|
|
145
|
-
assert.equal(activity[0]?.operation, "modified");
|
|
146
|
-
assert.equal(activity[0]?.diffLines, undefined);
|
|
147
|
-
} finally {
|
|
148
|
-
rmSync(root, { recursive: true, force: true });
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
test("creates green/red diff excerpts for mixed edits", () => {
|
|
153
|
-
const diff = createTextDiffExcerpt(
|
|
154
|
-
["alpha", "beta", "gamma"].join("\n"),
|
|
155
|
-
["alpha", "beta-2", "gamma", "delta"].join("\n"),
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
assert(diff);
|
|
159
|
-
assert.equal(diff.addedLines, 2);
|
|
160
|
-
assert.equal(diff.removedLines, 1);
|
|
161
|
-
assert.equal(diff.diffLines?.some((line) => line.kind === "added"), true);
|
|
162
|
-
assert.equal(diff.diffLines?.some((line) => line.kind === "removed"), true);
|
|
163
|
-
});
|