@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
22
33import {
44 createRequestId ,
5- serializeValue ,
5+ safeStringify ,
66 shortId ,
77 sizeOf ,
88} from "@/logging/utils" ;
@@ -70,19 +70,19 @@ describe("Logging utils", () => {
7070 } ) ;
7171 } ) ;
7272
73- describe ( "serializeValue " , ( ) => {
73+ describe ( "safeStringify " , ( ) => {
7474 it ( "formats various data types" , ( ) => {
75- expect ( serializeValue ( { key : "value" } ) ) . toContain ( "key: 'value'" ) ;
76- expect ( serializeValue ( "plain text" ) ) . toContain ( "plain text" ) ;
77- expect ( serializeValue ( [ 1 , 2 , 3 ] ) ) . toContain ( "1" ) ;
78- expect ( serializeValue ( 123 ) ) . toContain ( "123" ) ;
79- expect ( serializeValue ( true ) ) . toContain ( "true" ) ;
75+ expect ( safeStringify ( { key : "value" } ) ) . toContain ( "key: 'value'" ) ;
76+ expect ( safeStringify ( "plain text" ) ) . toContain ( "plain text" ) ;
77+ expect ( safeStringify ( [ 1 , 2 , 3 ] ) ) . toContain ( "1" ) ;
78+ expect ( safeStringify ( 123 ) ) . toContain ( "123" ) ;
79+ expect ( safeStringify ( true ) ) . toContain ( "true" ) ;
8080 } ) ;
8181
8282 it ( "handles circular references safely" , ( ) => {
8383 const circular : Record < string , unknown > = { a : 1 } ;
8484 circular . self = circular ;
85- const result = serializeValue ( circular ) ;
85+ const result = safeStringify ( circular ) ;
8686 expect ( result ) . toBeTruthy ( ) ;
8787 expect ( result ) . toContain ( "a: 1" ) ;
8888 } ) ;
@@ -91,7 +91,7 @@ describe("Logging utils", () => {
9191 const deep = {
9292 level1 : { level2 : { level3 : { level4 : { value : "deep" } } } } ,
9393 } ;
94- const result = serializeValue ( deep ) ;
94+ const result = safeStringify ( deep ) ;
9595 expect ( result ) . toContain ( "level4: { value: 'deep' }" ) ;
9696 } ) ;
9797 } ) ;
0 commit comments