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
70 it.effect("parses Windows process JSON through Schema and skips invalid rows", () =>70 it.effect("parses Windows process JSON through Schema and skips invalid rows", () =>
71 Effect.sync(() => {71 Effect.sync(() => {
72 const rows = ProcessDiagnostics.parseWindowsProcessRows(72 const rows = ProcessDiagnostics.parseWindowsProcessRows(
73 JSON.stringify([73 `[
74 {74 {
75 ProcessId: 10,75 "ProcessId": 10,
76 ParentProcessId: 1,76 "ParentProcessId": 1,
77 CommandLine: "",77 "CommandLine": "",
78 Name: "node.exe",78 "Name": "node.exe",
79 Status: "",79 "Status": "",
80 WorkingSetSize: 1024.4,80 "WorkingSetSize": 1024.4,
81 PercentProcessorTime: 12.5,81 "PercentProcessorTime": 12.5
82 },82 },
83 {83 {
84 ProcessId: "not-a-number",84 "ProcessId": "not-a-number",
85 ParentProcessId: 1,85 "ParentProcessId": 1,
86 Name: "bad.exe",86 "Name": "bad.exe"
87 },87 }
88 ]),88 ]`,
89 );89 );
90 90
91 assert.deepEqual(rows, [91 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