History

Avoid JSON stringify in process diagnostics test

Cursor Agent committed 4 months ago

Commit b5d4e921 parent a57be611 file · +13 −13Browse files

Unified · Split

apps/server/src/diagnostics/ProcessDiagnostics.test.ts+13−13
@@ -70,22 +70,22 @@ describe("ProcessDiagnostics", () => { · 69 unmodified lines
7070 it.effect("parses Windows process JSON through Schema and skips invalid rows", () =>
7171 Effect.sync(() => {
7272 const rows = ProcessDiagnostics.parseWindowsProcessRows(
73− JSON.stringify([
73+ `[
7474 {
75− ProcessId: 10,
76− ParentProcessId: 1,
77− CommandLine: "",
78− Name: "node.exe",
79− Status: "",
80− WorkingSetSize: 1024.4,
81− PercentProcessorTime: 12.5,
75+ "ProcessId": 10,
76+ "ParentProcessId": 1,
77+ "CommandLine": "",
78+ "Name": "node.exe",
79+ "Status": "",
80+ "WorkingSetSize": 1024.4,
81+ "PercentProcessorTime": 12.5
8282 },
8383 {
84− ProcessId: "not-a-number",
85− ParentProcessId: 1,
86− Name: "bad.exe",
87− },
88− ]),
84+ "ProcessId": "not-a-number",
85+ "ParentProcessId": 1,
86+ "Name": "bad.exe"
87+ }
88+ ]`,
8989 );
9090
9191 assert.deepEqual(rows, [

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t