From b90adfd2bfaf2402c6ee23e16c1539d11a6299a3 Mon Sep 17 00:00:00 2001 From: Ciaran Date: Fri, 27 Feb 2026 21:44:02 +0200 Subject: [PATCH 1/7] feat(tests/ArgumentConverter.test.ts): add failing test for JSON formatting around the '1' character --- tests/ArgumentConverter.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/ArgumentConverter.test.ts b/tests/ArgumentConverter.test.ts index faa0e88..f19530d 100644 --- a/tests/ArgumentConverter.test.ts +++ b/tests/ArgumentConverter.test.ts @@ -34,3 +34,14 @@ it('convert to primitive with a null argument', () => { expect(result.value).toBeNull(); expect(result.isHtml).toBe(false); }); + +// Tests that convertToPrimive returns string value and isHtml property is true when an object or array argument is passed +it('converts json to html without formatting issues', () => { + const arg = ['foo', 'bar', 123, { A: 123 }, null]; + const result = ArgumentConverter.convertToPrimitive(arg); + + expect(result.value).toBe( + ' [
    "foo",
    "bar",
    123,
    Object {
        "A"123,
    }
,
    null,
]
', + ); + expect(result.isHtml).toBe(true); +}); From dbf16fee6f38d7924789f9058c40c6a78c21b2c1 Mon Sep 17 00:00:00 2001 From: Ciaran Date: Fri, 27 Feb 2026 21:44:46 +0200 Subject: [PATCH 2/7] fix(src/ArgumentConverter.ts): use correct indent type for prettyFormat config --- src/ArgumentConverter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArgumentConverter.ts b/src/ArgumentConverter.ts index e07b0cb..db53d64 100644 --- a/src/ArgumentConverter.ts +++ b/src/ArgumentConverter.ts @@ -31,7 +31,7 @@ export class ArgumentConverter { } public static prettyFormatForHtml(arg: any): string { - const formatted = prettyFormat(arg, { indent: ' ' } as any) + const formatted = prettyFormat(arg, { indent: 4 }) // format whitespace for display in html .replaceAll(' ', ' ') .replace(/\r\n|\r|\n/g, '
') From 927991ee3822387ba0beaa6207ea81497e35f513 Mon Sep 17 00:00:00 2001 From: Ciaran Date: Fri, 27 Feb 2026 21:45:48 +0200 Subject: [PATCH 3/7] chore(tests/__snapshots__): update snapshots --- tests/__snapshots__/Ray.test.ts.snap | 944 +++++++++++------------ tests/__snapshots__/RayNode.test.ts.snap | 132 ++-- 2 files changed, 538 insertions(+), 538 deletions(-) diff --git a/tests/__snapshots__/Ray.test.ts.snap b/tests/__snapshots__/Ray.test.ts.snap index 793cc34..991f501 100644 --- a/tests/__snapshots__/Ray.test.ts.snap +++ b/tests/__snapshots__/Ray.test.ts.snap @@ -1,27 +1,26 @@ -// Bun Snapshot v1, https://bun.sh/docs/test/snapshots +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`allows setting the url scheme to https 1`] = ` +exports[`allows defaults to the http url scheme 1`] = ` [ - "https://otherhost:3000/", + "http://localhost:23517/", ] `; -exports[`allows defaults to the http url scheme 1`] = ` +exports[`allows setting the url scheme to https 1`] = ` [ - "http://localhost:23517/", + "https://otherhost:3000/", ] `; -exports[`sends the ray ban payload 1`] = ` +exports[`can chain method calls when using if with a callback and a false condition 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "values": [ - "🕶", - ], + "content": "two", + "label": "Text", }, "origin": { "file": "", @@ -29,73 +28,68 @@ exports[`sends the ray ban payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "custom", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends the ray charles payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "values": [ - "🎶 🎹 🎷 🕺", - ], + "color": "blue", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a color payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "color": "red", + "content": "three", + "label": "Text", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "custom", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`can chain multiple if calls with callbacks together 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "green", + "content": "test", + "label": "Text", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -105,7 +99,7 @@ exports[`sends a color payload 1`] = ` "payloads": [ { "content": { - "color": "orange", + "color": "green", }, "origin": { "file": "/tests/Ray.test.ts", @@ -123,7 +117,7 @@ exports[`sends a color payload 1`] = ` "payloads": [ { "content": { - "color": "red", + "size": "lg", }, "origin": { "file": "/tests/Ray.test.ts", @@ -131,7 +125,7 @@ exports[`sends a color payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "size", }, ], "uuid": "fakeUuid", @@ -140,34 +134,38 @@ exports[`sends a color payload 1`] = ` "meta": [], "payloads": [ { - "content": { - "color": "purple", - }, + "content": {}, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "hide", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`can send additional payloads from the sent payload callback 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "blue", + "content": "test", + "label": "HTML", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -177,7 +175,7 @@ exports[`sends a color payload 1`] = ` "payloads": [ { "content": { - "color": "gray", + "color": "purple", }, "origin": { "file": "/tests/Ray.test.ts", @@ -193,14 +191,15 @@ exports[`sends a color payload 1`] = ` ] `; -exports[`sends screen color payloads 1`] = ` +exports[`can send payloads from the sending payload callback 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "color": "green", + "content": "sent before the main payload", + "label": "HTML", }, "origin": { "file": "", @@ -208,7 +207,7 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -218,7 +217,8 @@ exports[`sends screen color payloads 1`] = ` "payloads": [ { "content": { - "color": "orange", + "content": "test", + "label": "HTML", }, "origin": { "file": "", @@ -226,17 +226,25 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "custom", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`can transform a request into JSON 1`] = `"{"uuid":"1-2-3-4","payloads":[],"meta":[{"test_version":1}]}"`; + +exports[`chains payloads together 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "red", + "content": "one", + "label": "Text", }, "origin": { "file": "", @@ -244,17 +252,47 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "custom", + }, + { + "content": { + "color": "green", + }, + "origin": { + "file": "/tests/Ray.test.ts", + "function_name": "xxxx", + "hostname": "remote", + "line_number": 999, + }, + "type": "color", + }, + { + "content": { + "label": "test", + }, + "origin": { + "file": "", + "function_name": "xxxx", + "hostname": "remote", + "line_number": 999, + }, + "type": "label", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`doesn't blow up when calling html without a value 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "purple", + "content": "", + "label": "HTML", }, "origin": { "file": "", @@ -262,7 +300,7 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -272,7 +310,8 @@ exports[`sends screen color payloads 1`] = ` "payloads": [ { "content": { - "color": "blue", + "content": "", + "label": "HTML", }, "origin": { "file": "", @@ -280,17 +319,27 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "custom", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`measures the execution time of a closure 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "gray", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "closure", + "time_since_last_call": 0, + "total_time": 20, }, "origin": { "file": "", @@ -298,7 +347,7 @@ exports[`sends screen color payloads 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -306,14 +355,19 @@ exports[`sends screen color payloads 1`] = ` ] `; -exports[`sends a custom screen color payload 1`] = ` +exports[`measures the execution time of named stopwatches 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "color": "red", + "is_new_timer": true, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "first", + "time_since_last_call": 0, + "total_time": 0, }, "origin": { "file": "", @@ -321,22 +375,22 @@ exports[`sends a custom screen color payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "screen_color", + "type": "measure", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a label payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "label": "test-123", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "first", + "time_since_last_call": 0, + "total_time": 20, }, "origin": { "file": "", @@ -344,7 +398,7 @@ exports[`sends a label payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "label", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -352,22 +406,27 @@ exports[`sends a label payload 1`] = ` ] `; -exports[`sends a size payload 1`] = ` +exports[`measures the execution time of repeated and unnamed calls to measure 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "size": "lg", + "is_new_timer": true, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "default", + "time_since_last_call": 0, + "total_time": 0, }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "size", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -377,15 +436,20 @@ exports[`sends a size payload 1`] = ` "payloads": [ { "content": { - "size": "sm", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "default", + "time_since_last_call": 0, + "total_time": 20, }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "size", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -395,15 +459,20 @@ exports[`sends a size payload 1`] = ` "payloads": [ { "content": { - "size": "lg", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "default", + "time_since_last_call": 20, + "total_time": 40, }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "size", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -411,14 +480,14 @@ exports[`sends a size payload 1`] = ` ] `; -exports[`sends a new screen payload 1`] = ` +exports[`pauses code execution 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "name": "test 1", + "name": "xxxxx", }, "origin": { "file": "", @@ -426,7 +495,7 @@ exports[`sends a new screen payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "new_screen", + "type": "create_lock", }, ], "uuid": "fakeUuid", @@ -434,14 +503,15 @@ exports[`sends a new screen payload 1`] = ` ] `; -exports[`sends a clear screen payload 1`] = ` +exports[`sends a boolean payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "name": "", + "content": true, + "label": "Boolean", }, "origin": { "file": "", @@ -449,7 +519,7 @@ exports[`sends a clear screen payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "new_screen", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -457,20 +527,28 @@ exports[`sends a clear screen payload 1`] = ` ] `; -exports[`sends a clear all payload 1`] = ` +exports[`sends a caller payload 1`] = ` [ { "meta": [], "payloads": [ { - "content": {}, + "content": { + "frame": { + "class": "", + "file_name": "Ray.ts", + "line_number": 999, + "method": "caller", + "vendor_frame": false, + }, + }, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "clear_all", + "type": "caller", }, ], "uuid": "fakeUuid", @@ -478,20 +556,24 @@ exports[`sends a clear all payload 1`] = ` ] `; -exports[`sends a confetti payload 1`] = ` +exports[`sends a classname payload 1`] = ` [ { "meta": [], "payloads": [ { - "content": {}, + "content": { + "values": [ + "Ray", + ], + }, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "confetti", + "type": "log", }, ], "uuid": "fakeUuid", @@ -499,15 +581,35 @@ exports[`sends a confetti payload 1`] = ` ] `; -exports[`sends an html payload 1`] = ` +exports[`sends a clear all payload 1`] = ` +[ + { + "meta": [], + "payloads": [ + { + "content": {}, + "origin": { + "file": "", + "function_name": "xxxx", + "hostname": "remote", + "line_number": 999, + }, + "type": "clear_all", + }, + ], + "uuid": "fakeUuid", + }, +] +`; + +exports[`sends a clear screen payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "test", - "label": "HTML", + "name": "", }, "origin": { "file": "", @@ -515,7 +617,7 @@ exports[`sends an html payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "new_screen", }, ], "uuid": "fakeUuid", @@ -523,23 +625,22 @@ exports[`sends an html payload 1`] = ` ] `; -exports[`doesn't blow up when calling html without a value 1`] = ` +exports[`sends a color payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "", - "label": "HTML", + "color": "red", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", @@ -549,40 +650,33 @@ exports[`doesn't blow up when calling html without a value 1`] = ` "payloads": [ { "content": { - "content": "", - "label": "HTML", + "color": "green", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a text payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "test 1", - "label": "Text", + "color": "orange", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", @@ -592,90 +686,69 @@ exports[`sends a text payload 1`] = ` "payloads": [ { "content": { - "content": "<em>test 2</em>", - "label": "Text", + "color": "red", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends an image payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "", - "label": "Image", + "color": "purple", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends an xml payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "<root>
    <abc>1</abc>
</root>", - "label": "XML", + "color": "blue", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a json string payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": { - "A": 123, - }, - "label": "JSON", + "color": "gray", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "color", }, ], "uuid": "fakeUuid", @@ -683,22 +756,20 @@ exports[`sends a json string payload 1`] = ` ] `; -exports[`sends an object as json payload 1`] = ` +exports[`sends a confetti payload 1`] = ` [ { "meta": [], "payloads": [ { - "content": { - "value": ""{\\"a\\":1,\\"b\\":2}"", - }, + "content": {}, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "json_string", + "type": "confetti", }, ], "uuid": "fakeUuid", @@ -706,16 +777,15 @@ exports[`sends an object as json payload 1`] = ` ] `; -exports[`sends a classname payload 1`] = ` +exports[`sends a custom payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "values": [ - "Ray", - ], + "content": "test 123", + "label": "test", }, "origin": { "file": "", @@ -723,22 +793,18 @@ exports[`sends a classname payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "custom", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a notify payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "value": "hello world", + "content": "test 4", + "label": "", }, "origin": { "file": "", @@ -746,23 +812,18 @@ exports[`sends a notify payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "notify", + "type": "custom", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends an error payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "Error:
test error", - "label": "Error", + "content": "test 5", + "label": "", }, "origin": { "file": "", @@ -780,15 +841,16 @@ exports[`sends an error payload 1`] = ` "payloads": [ { "content": { - "color": "red", + "content": "test 5", + "label": "", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -796,16 +858,14 @@ exports[`sends an error payload 1`] = ` ] `; -exports[`sends a raw payload 1`] = ` +exports[`sends a custom screen color payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "values": [ - "one", - ], + "color": "red", }, "origin": { "file": "", @@ -813,21 +873,28 @@ exports[`sends a raw payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "screen_color", }, + ], + "uuid": "fakeUuid", + }, +] +`; + +exports[`sends a hide payload 1`] = ` +[ + { + "meta": [], + "payloads": [ { - "content": { - "values": [ - "two", - ], - }, + "content": {}, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "hide", }, ], "uuid": "fakeUuid", @@ -835,36 +902,48 @@ exports[`sends a raw payload 1`] = ` ] `; -exports[`sends show and hide app payloads 1`] = ` +exports[`sends a json string payload 1`] = ` [ { "meta": [], "payloads": [ { - "content": {}, + "content": { + "content": { + "A": 123, + }, + "label": "JSON", + }, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "show_app", + "type": "custom", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a label payload 1`] = ` +[ { "meta": [], "payloads": [ { - "content": {}, + "content": { + "label": "test-123", + }, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "hide_app", + "type": "label", }, ], "uuid": "fakeUuid", @@ -872,15 +951,14 @@ exports[`sends show and hide app payloads 1`] = ` ] `; -exports[`sends a null payload 1`] = ` +exports[`sends a new screen payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": null, - "label": "Null", + "name": "test 1", }, "origin": { "file": "", @@ -888,7 +966,7 @@ exports[`sends a null payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "new_screen", }, ], "uuid": "fakeUuid", @@ -896,15 +974,14 @@ exports[`sends a null payload 1`] = ` ] `; -exports[`sends a boolean payload 1`] = ` +exports[`sends a notify payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": true, - "label": "Boolean", + "value": "hello world", }, "origin": { "file": "", @@ -912,7 +989,7 @@ exports[`sends a boolean payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "notify", }, ], "uuid": "fakeUuid", @@ -920,16 +997,15 @@ exports[`sends a boolean payload 1`] = ` ] `; -exports[`sends a string payload 1`] = ` +exports[`sends a null payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "values": [ - "test", - ], + "content": null, + "label": "Null", }, "origin": { "file": "", @@ -937,7 +1013,7 @@ exports[`sends a string payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "log", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -945,20 +1021,38 @@ exports[`sends a string payload 1`] = ` ] `; -exports[`sends a hide payload 1`] = ` +exports[`sends a raw payload 1`] = ` [ { "meta": [], "payloads": [ { - "content": {}, + "content": { + "values": [ + "one", + ], + }, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "hide", + "type": "log", + }, + { + "content": { + "values": [ + "two", + ], + }, + "origin": { + "file": "", + "function_name": "xxxx", + "hostname": "remote", + "line_number": 999, + }, + "type": "log", }, ], "uuid": "fakeUuid", @@ -987,22 +1081,14 @@ exports[`sends a remove payload 1`] = ` ] `; -exports[`sends a table payload 1`] = ` +exports[`sends a screen color payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "label": "table", - "values": [ - 1, - 2, - "Object {
    1"A"1,
}
", - "Ray {
    1"canSendPayload"true,
    1"chainedPayloads"Array [],
    1"chaining"false,
    1"inCallback"false,
    1"limitOrigin"null,
    1"settings"Settings {
    1    1"_host""localhost",
    1    1"_port"23510,
    1    1"_scheme""http",
    1    1"always_send_raw_values"false,
    1    1"enable"true,
    1    1"enabled_callback"null,
    1    1"intercept_console_log"false,
    1    1"local_path"null,
    1    1"not_defined"false,
    1    1"originalSettings"Object {
    1    1    1"always_send_raw_values"false,
    1    1    1"enable"true,
    1    1    1"host""localhost",
    1    1    1"local_path"null,
    1    1    1"not_defined"false,
    1    1    1"port"23510,
    1    1    1"remote_path"null,
    1    1},
    1    1"remote_path"null,
    1    1"sending_payload_callback"null,
    1    1"sent_payload_callback"null,
    1},
    1"uuid""fakeUuid",
}
", - true, - null, - ], + "color": "red", }, "origin": { "file": "", @@ -1010,7 +1096,7 @@ exports[`sends a table payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "table", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1020,12 +1106,7 @@ exports[`sends a table payload 1`] = ` "payloads": [ { "content": { - "label": "Table", - "values": [ - " [
    13,
    14,
]
", - "Object {
    1"B"2,
}
", - false, - ], + "color": "green", }, "origin": { "file": "", @@ -1033,29 +1114,51 @@ exports[`sends a table payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "table", + "type": "screen_color", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a separator payload 1`] = ` +[ + { + "meta": [], + "payloads": [ + { + "content": {}, + "origin": { + "file": "", + "function_name": "xxxx", + "hostname": "remote", + "line_number": 999, + }, + "type": "separator", + }, + ], + "uuid": "fakeUuid", + }, +] +`; + +exports[`sends a size payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "label": "Table", - "values": { - "counter": 123, - "message": "hello world", - }, + "size": "lg", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "table", + "type": "size", }, ], "uuid": "fakeUuid", @@ -1065,54 +1168,50 @@ exports[`sends a table payload 1`] = ` "payloads": [ { "content": { - "label": "Test", - "values": { - "name": "test", - "value": 987, - }, + "size": "sm", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "table", + "type": "size", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends a custom payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "test 123", - "label": "test", + "size": "lg", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "size", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a string payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "content": "test 4", - "label": "", + "values": [ + "test", + ], }, "origin": { "file": "", @@ -1120,18 +1219,30 @@ exports[`sends a custom payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "log", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a table payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "content": "test 5", - "label": "", + "label": "table", + "values": [ + 1, + 2, + "Object {
    "A"1,
}
", + "Ray {
    "canSendPayload"true,
    "chainedPayloads"Array [],
    "chaining"false,
    "inCallback"false,
    "limitOrigin"null,
    "settings"Settings {
        "_host""localhost",
        "_port"23510,
        "_scheme""http",
        "always_send_raw_values"false,
        "enable"true,
        "enabled_callback"null,
        "intercept_console_log"false,
        "local_path"null,
        "not_defined"false,
        "originalSettings"Object {
            "always_send_raw_values"false,
            "enable"true,
            "host""localhost",
            "local_path"null,
            "not_defined"false,
            "port"23510,
            "remote_path"null,
        },
        "remote_path"null,
        "sending_payload_callback"null,
        "sent_payload_callback"null,
    },
    "uuid""fakeUuid",
}
", + true, + null, + ], }, "origin": { "file": "", @@ -1139,7 +1250,7 @@ exports[`sends a custom payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "table", }, ], "uuid": "fakeUuid", @@ -1149,8 +1260,12 @@ exports[`sends a custom payload 1`] = ` "payloads": [ { "content": { - "content": "test 5", - "label": "", + "label": "Table", + "values": [ + " [
    3,
    4,
]
", + "Object {
    "B"2,
}
", + false, + ], }, "origin": { "file": "", @@ -1158,29 +1273,21 @@ exports[`sends a custom payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "table", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`can transform a request into JSON 1`] = `"{"uuid":"1-2-3-4","payloads":[],"meta":[{"test_version":1}]}"`; - -exports[`measures the execution time of a closure 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "closure", - "time_since_last_call": 0, - "total_time": 20, + "label": "Table", + "values": { + "counter": 123, + "message": "hello world", + }, }, "origin": { "file": "", @@ -1188,27 +1295,21 @@ exports[`measures the execution time of a closure 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "table", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`measures the execution time of repeated and unnamed calls to measure 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": true, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "default", - "time_since_last_call": 0, - "total_time": 0, + "label": "Test", + "values": { + "name": "test", + "value": 987, + }, }, "origin": { "file": "", @@ -1216,22 +1317,23 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "table", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a text payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "default", - "time_since_last_call": 0, - "total_time": 20, + "content": "test 1", + "label": "Text", }, "origin": { "file": "", @@ -1239,7 +1341,7 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -1249,12 +1351,8 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "default", - "time_since_last_call": 20, - "total_time": 40, + "content": "<em>test 2</em>", + "label": "Text", }, "origin": { "file": "", @@ -1262,7 +1360,7 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -1270,19 +1368,14 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` ] `; -exports[`measures the execution time of named stopwatches 1`] = ` +exports[`sends a trace payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "is_new_timer": true, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "first", - "time_since_last_call": 0, - "total_time": 0, + "frames": [], }, "origin": { "file": "", @@ -1290,22 +1383,23 @@ exports[`measures the execution time of named stopwatches 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "trace", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends an error payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "first", - "time_since_last_call": 0, - "total_time": 20, + "content": "Error:
test error", + "label": "Error", }, "origin": { "file": "", @@ -1313,30 +1407,25 @@ exports[`measures the execution time of named stopwatches 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`pauses code execution 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "name": "xxxxx", + "color": "red", }, "origin": { - "file": "", + "file": "/tests/Ray.test.ts", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "create_lock", + "type": "color", }, ], "uuid": "fakeUuid", @@ -1344,15 +1433,17 @@ exports[`pauses code execution 1`] = ` ] `; -exports[`sends an html payload when calling ray() with an object argument 1`] = ` +exports[`sends an event payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "Object {
    1"A"123,
    1"B" [
    1    14,
    1    15,
    1    16,
    1]
,
}
", - "label": "HTML", + "class_based_event": true, + "event": undefined, + "name": "testevent", + "payload": "Array []", }, "origin": { "file": "", @@ -1360,7 +1451,7 @@ exports[`sends an html payload when calling ray() with an object argument 1`] = "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "event", }, ], "uuid": "fakeUuid", @@ -1378,10 +1469,10 @@ exports[`sends an exception payload 1`] = ` "class": "Error", "frames": [ { - "class": undefined, + "class": "unknown", "file_name": "/tests/Ray.test.ts", "line_number": 999, - "method": "", + "method": "unknown", "snippet": [], "vendor_frame": false, }, @@ -1431,10 +1522,10 @@ exports[`sends an exception payload with metadata 1`] = ` "class": "Error", "frames": [ { - "class": undefined, + "class": "unknown", "file_name": "/tests/Ray.test.ts", "line_number": 999, - "method": "", + "method": "unknown", "snippet": [], "vendor_frame": false, }, @@ -1478,17 +1569,15 @@ exports[`sends an exception payload with metadata 1`] = ` ] `; -exports[`sends an event payload 1`] = ` +exports[`sends an html markup payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "class_based_event": true, - "event": undefined, - "name": "testevent", - "payload": "Array []", + "content": "<em>test</em>", + "label": "Markup", }, "origin": { "file": "", @@ -1496,7 +1585,7 @@ exports[`sends an event payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "event", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -1504,20 +1593,15 @@ exports[`sends an event payload 1`] = ` ] `; -exports[`sends a caller payload 1`] = ` +exports[`sends an html payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "frame": { - "class": "", - "file_name": "Ray.ts", - "line_number": 999, - "method": "caller", - "vendor_frame": false, - }, + "content": "test", + "label": "HTML", }, "origin": { "file": "", @@ -1525,7 +1609,7 @@ exports[`sends a caller payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "caller", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -1533,14 +1617,14 @@ exports[`sends a caller payload 1`] = ` ] `; -exports[`can send payloads from the sending payload callback 1`] = ` +exports[`sends an html payload when calling ray() with an object argument 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "sent before the main payload", + "content": "Object {
    "A"123,
    "B" [
        4,
        5,
        6,
    ]
,
}
", "label": "HTML", }, "origin": { @@ -1554,13 +1638,18 @@ exports[`can send payloads from the sending payload callback 1`] = ` ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends an image payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "content": "test", - "label": "HTML", + "content": "", + "label": "Image", }, "origin": { "file": "", @@ -1576,15 +1665,14 @@ exports[`can send payloads from the sending payload callback 1`] = ` ] `; -exports[`can send additional payloads from the sent payload callback 1`] = ` +exports[`sends an object as json payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "test", - "label": "HTML", + "value": ""{\\"a\\":1,\\"b\\":2}"", }, "origin": { "file": "", @@ -1592,25 +1680,31 @@ exports[`can send additional payloads from the sent payload callback 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "json_string", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends an xml payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "color": "purple", + "content": "<root>
    <abc>1</abc>
</root>", + "label": "XML", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -1618,15 +1712,14 @@ exports[`can send additional payloads from the sent payload callback 1`] = ` ] `; -exports[`can chain method calls when using if with a callback and a false condition 1`] = ` +exports[`sends screen color payloads 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "two", - "label": "Text", + "color": "green", }, "origin": { "file": "", @@ -1634,7 +1727,7 @@ exports[`can chain method calls when using if with a callback and a false condit "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1644,15 +1737,15 @@ exports[`can chain method calls when using if with a callback and a false condit "payloads": [ { "content": { - "color": "blue", + "color": "orange", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1662,8 +1755,7 @@ exports[`can chain method calls when using if with a callback and a false condit "payloads": [ { "content": { - "content": "three", - "label": "Text", + "color": "red", }, "origin": { "file": "", @@ -1671,23 +1763,17 @@ exports[`can chain method calls when using if with a callback and a false condit "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "screen_color", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`can chain multiple if calls with callbacks together 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "test", - "label": "Text", + "color": "purple", }, "origin": { "file": "", @@ -1695,7 +1781,7 @@ exports[`can chain multiple if calls with callbacks together 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1705,15 +1791,15 @@ exports[`can chain multiple if calls with callbacks together 1`] = ` "payloads": [ { "content": { - "color": "green", + "color": "blue", }, "origin": { - "file": "/tests/Ray.test.ts", + "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "color", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1723,31 +1809,15 @@ exports[`can chain multiple if calls with callbacks together 1`] = ` "payloads": [ { "content": { - "size": "lg", - }, - "origin": { - "file": "/tests/Ray.test.ts", - "function_name": "xxxx", - "hostname": "remote", - "line_number": 999, + "color": "gray", }, - "type": "size", - }, - ], - "uuid": "fakeUuid", - }, - { - "meta": [], - "payloads": [ - { - "content": {}, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "hide", + "type": "screen_color", }, ], "uuid": "fakeUuid", @@ -1755,7 +1825,7 @@ exports[`can chain multiple if calls with callbacks together 1`] = ` ] `; -exports[`sends a separator payload 1`] = ` +exports[`sends show and hide app payloads 1`] = ` [ { "meta": [], @@ -1768,72 +1838,23 @@ exports[`sends a separator payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "separator", - }, - ], - "uuid": "fakeUuid", - }, -] -`; - -exports[`sends a screen color payload 1`] = ` -[ - { - "meta": [], - "payloads": [ - { - "content": { - "color": "red", - }, - "origin": { - "file": "", - "function_name": "xxxx", - "hostname": "remote", - "line_number": 999, - }, - "type": "screen_color", - }, - ], - "uuid": "fakeUuid", - }, - { - "meta": [], - "payloads": [ - { - "content": { - "color": "green", - }, - "origin": { - "file": "", - "function_name": "xxxx", - "hostname": "remote", - "line_number": 999, - }, - "type": "screen_color", + "type": "show_app", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends an html markup payload 1`] = ` -[ { "meta": [], "payloads": [ { - "content": { - "content": "<em>test</em>", - "label": "Markup", - }, + "content": {}, "origin": { "file": "", "function_name": "xxxx", "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "hide_app", }, ], "uuid": "fakeUuid", @@ -1841,14 +1862,16 @@ exports[`sends an html markup payload 1`] = ` ] `; -exports[`sends a trace payload 1`] = ` +exports[`sends the ray ban payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "frames": [], + "values": [ + "🕶", + ], }, "origin": { "file": "", @@ -1856,7 +1879,7 @@ exports[`sends a trace payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "trace", + "type": "log", }, ], "uuid": "fakeUuid", @@ -1864,39 +1887,16 @@ exports[`sends a trace payload 1`] = ` ] `; -exports[`chains payloads together 1`] = ` +exports[`sends the ray charles payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "one", - "label": "Text", - }, - "origin": { - "file": "", - "function_name": "xxxx", - "hostname": "remote", - "line_number": 999, - }, - "type": "custom", - }, - { - "content": { - "color": "green", - }, - "origin": { - "file": "/tests/Ray.test.ts", - "function_name": "xxxx", - "hostname": "remote", - "line_number": 999, - }, - "type": "color", - }, - { - "content": { - "label": "test", + "values": [ + "🎶 🎹 🎷 🕺", + ], }, "origin": { "file": "", @@ -1904,7 +1904,7 @@ exports[`chains payloads together 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "label", + "type": "log", }, ], "uuid": "fakeUuid", diff --git a/tests/__snapshots__/RayNode.test.ts.snap b/tests/__snapshots__/RayNode.test.ts.snap index 31498f8..ca21d24 100644 --- a/tests/__snapshots__/RayNode.test.ts.snap +++ b/tests/__snapshots__/RayNode.test.ts.snap @@ -1,14 +1,20 @@ -// Bun Snapshot v1, https://bun.sh/docs/test/snapshots +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`sends an existing file payload 1`] = ` +exports[`gets the node runtime info 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "one,two,three
", - "label": "test.txt", + "label": "NodeInfo", + "values": { + "Extensions": "xxx", + "Memory Heap usage": 999, + "Memory RSS usage": 999, + "Node version": "v999", + "V8 version": "v999", + }, }, "origin": { "file": "/test/file.js", @@ -16,7 +22,7 @@ exports[`sends an existing file payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "table", }, ], "uuid": "fakeUuid", @@ -24,15 +30,19 @@ exports[`sends an existing file payload 1`] = ` ] `; -exports[`sends a missing file payload 1`] = ` +exports[`measures the execution time of a closure 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "File not found: '{missing.txt'", - "label": "File", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "closure", + "time_since_last_call": 0, + "total_time": 20, }, "origin": { "file": "/test/file.js", @@ -40,7 +50,7 @@ exports[`sends a missing file payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -48,15 +58,19 @@ exports[`sends a missing file payload 1`] = ` ] `; -exports[`sends an existing image file payload 1`] = ` +exports[`measures the execution time of named stopwatches 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "content": "", - "label": "Image", + "is_new_timer": true, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "first", + "time_since_last_call": 0, + "total_time": 0, }, "origin": { "file": "/test/file.js", @@ -64,23 +78,22 @@ exports[`sends an existing image file payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "measure", }, ], "uuid": "fakeUuid", }, -] -`; - -exports[`sends an image url payload 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "content": "", - "label": "Image", + "is_new_timer": false, + "max_memory_usage_during_total_time": 0, + "max_memory_usage_since_last_call": 0, + "name": "first", + "time_since_last_call": 0, + "total_time": 20, }, "origin": { "file": "/test/file.js", @@ -88,7 +101,7 @@ exports[`sends an image url payload 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "custom", + "type": "measure", }, ], "uuid": "fakeUuid", @@ -96,19 +109,19 @@ exports[`sends an image url payload 1`] = ` ] `; -exports[`measures the execution time of a closure 1`] = ` +exports[`measures the execution time of repeated and unnamed calls to measure 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, + "is_new_timer": true, "max_memory_usage_during_total_time": 0, "max_memory_usage_since_last_call": 0, - "name": "closure", + "name": "default", "time_since_last_call": 0, - "total_time": 20, + "total_time": 0, }, "origin": { "file": "/test/file.js", @@ -121,22 +134,17 @@ exports[`measures the execution time of a closure 1`] = ` ], "uuid": "fakeUuid", }, -] -`; - -exports[`measures the execution time of repeated and unnamed calls to measure 1`] = ` -[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": true, + "is_new_timer": false, "max_memory_usage_during_total_time": 0, "max_memory_usage_since_last_call": 0, "name": "default", "time_since_last_call": 0, - "total_time": 0, + "total_time": 20, }, "origin": { "file": "/test/file.js", @@ -158,8 +166,8 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "max_memory_usage_during_total_time": 0, "max_memory_usage_since_last_call": 0, "name": "default", - "time_since_last_call": 0, - "total_time": 20, + "time_since_last_call": 20, + "total_time": 40, }, "origin": { "file": "/test/file.js", @@ -172,17 +180,18 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends a missing file payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "default", - "time_since_last_call": 20, - "total_time": 40, + "content": "File not found: '{missing.txt'", + "label": "File", }, "origin": { "file": "/test/file.js", @@ -190,7 +199,7 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -198,19 +207,15 @@ exports[`measures the execution time of repeated and unnamed calls to measure 1` ] `; -exports[`measures the execution time of named stopwatches 1`] = ` +exports[`sends an existing file payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "is_new_timer": true, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "first", - "time_since_last_call": 0, - "total_time": 0, + "content": "one,two,three
", + "label": "test.txt", }, "origin": { "file": "/test/file.js", @@ -218,22 +223,23 @@ exports[`measures the execution time of named stopwatches 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", }, +] +`; + +exports[`sends an existing image file payload 1`] = ` +[ { "meta": [], "payloads": [ { "content": { - "is_new_timer": false, - "max_memory_usage_during_total_time": 0, - "max_memory_usage_since_last_call": 0, - "name": "first", - "time_since_last_call": 0, - "total_time": 20, + "content": "", + "label": "Image", }, "origin": { "file": "/test/file.js", @@ -241,7 +247,7 @@ exports[`measures the execution time of named stopwatches 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "measure", + "type": "custom", }, ], "uuid": "fakeUuid", @@ -249,21 +255,15 @@ exports[`measures the execution time of named stopwatches 1`] = ` ] `; -exports[`gets the node runtime info 1`] = ` +exports[`sends an image url payload 1`] = ` [ { "meta": [], "payloads": [ { "content": { - "label": "NodeInfo", - "values": { - "Extensions": "xxx", - "Memory Heap usage": 999, - "Memory RSS usage": 999, - "Node version": "v999", - "V8 version": "v999", - }, + "content": "", + "label": "Image", }, "origin": { "file": "/test/file.js", @@ -271,7 +271,7 @@ exports[`gets the node runtime info 1`] = ` "hostname": "remote", "line_number": 999, }, - "type": "table", + "type": "custom", }, ], "uuid": "fakeUuid", From 8722d1c54cb11b29d1b7d2d71e720d4dc03d8e1b Mon Sep 17 00:00:00 2001 From: Ciaran Date: Fri, 27 Feb 2026 21:58:16 +0200 Subject: [PATCH 4/7] fix(tests/ArgumentConverter.test.ts): typo --- tests/ArgumentConverter.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ArgumentConverter.test.ts b/tests/ArgumentConverter.test.ts index f19530d..6d12049 100644 --- a/tests/ArgumentConverter.test.ts +++ b/tests/ArgumentConverter.test.ts @@ -35,7 +35,7 @@ it('convert to primitive with a null argument', () => { expect(result.isHtml).toBe(false); }); -// Tests that convertToPrimive returns string value and isHtml property is true when an object or array argument is passed +// Tests that convertToPrimitive returns string value and isHtml property is true when an object or array argument is passed it('converts json to html without formatting issues', () => { const arg = ['foo', 'bar', 123, { A: 123 }, null]; const result = ArgumentConverter.convertToPrimitive(arg); From 35cb0be0196b2e9ac460dd64688f3dacf8efce65 Mon Sep 17 00:00:00 2001 From: Ciaran Date: Fri, 27 Feb 2026 22:03:17 +0200 Subject: [PATCH 5/7] refactor(ArgumentConverter.test.ts): add decimal value to json -> html test case --- tests/ArgumentConverter.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ArgumentConverter.test.ts b/tests/ArgumentConverter.test.ts index 6d12049..a44cb10 100644 --- a/tests/ArgumentConverter.test.ts +++ b/tests/ArgumentConverter.test.ts @@ -37,11 +37,11 @@ it('convert to primitive with a null argument', () => { // Tests that convertToPrimitive returns string value and isHtml property is true when an object or array argument is passed it('converts json to html without formatting issues', () => { - const arg = ['foo', 'bar', 123, { A: 123 }, null]; + const arg = ['foo', 'bar', 123, 0.123, { A: 123 }, null]; const result = ArgumentConverter.convertToPrimitive(arg); expect(result.value).toBe( - ' [
    "foo",
    "bar",
    123,
    Object {
        "A"123,
    }
,
    null,
]
', + ' [
    "foo",
    "bar",
    123,
    0.123,
    Object {
        "A"123,
    }
,
    null,
]
', ); expect(result.isHtml).toBe(true); }); From 18980def45216dc0058f6ee107eeaf309f47b316 Mon Sep 17 00:00:00 2001 From: Ciaran Date: Sat, 28 Feb 2026 02:47:41 +0200 Subject: [PATCH 6/7] chore(Ray.test.ts.snap): update snapshot --- tests/__snapshots__/Ray.test.ts.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/__snapshots__/Ray.test.ts.snap b/tests/__snapshots__/Ray.test.ts.snap index 991f501..fd29242 100644 --- a/tests/__snapshots__/Ray.test.ts.snap +++ b/tests/__snapshots__/Ray.test.ts.snap @@ -1469,10 +1469,10 @@ exports[`sends an exception payload 1`] = ` "class": "Error", "frames": [ { - "class": "unknown", + "class": undefined, "file_name": "/tests/Ray.test.ts", "line_number": 999, - "method": "unknown", + "method": "", "snippet": [], "vendor_frame": false, }, @@ -1522,10 +1522,10 @@ exports[`sends an exception payload with metadata 1`] = ` "class": "Error", "frames": [ { - "class": "unknown", + "class": undefined, "file_name": "/tests/Ray.test.ts", "line_number": 999, - "method": "unknown", + "method": "", "snippet": [], "vendor_frame": false, }, From 713872398438cd796daa2fc593c03b094b2e6c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n?= <51886151+knightspore@users.noreply.github.com> Date: Sat, 28 Feb 2026 03:11:13 +0200 Subject: [PATCH 7/7] Update tests/ArgumentConverter.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- tests/ArgumentConverter.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ArgumentConverter.test.ts b/tests/ArgumentConverter.test.ts index a44cb10..937639b 100644 --- a/tests/ArgumentConverter.test.ts +++ b/tests/ArgumentConverter.test.ts @@ -36,7 +36,7 @@ it('convert to primitive with a null argument', () => { }); // Tests that convertToPrimitive returns string value and isHtml property is true when an object or array argument is passed -it('converts json to html without formatting issues', () => { +it('converts array with decimal numbers to html correctly', () => { const arg = ['foo', 'bar', 123, 0.123, { A: 123 }, null]; const result = ArgumentConverter.convertToPrimitive(arg);