From 3937553cdf5dfb28efee3b08072f7a3164ba75d9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 12 Apr 2024 18:33:18 -0700 Subject: [PATCH] snaps --- .../__snapshots__/stringify.test.ts.snap | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 __tests__/__snapshots__/stringify.test.ts.snap diff --git a/__tests__/__snapshots__/stringify.test.ts.snap b/__tests__/__snapshots__/stringify.test.ts.snap new file mode 100644 index 0000000..1f01dbf --- /dev/null +++ b/__tests__/__snapshots__/stringify.test.ts.snap @@ -0,0 +1,28 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`applies replacer function if provided 1`] = `"{firstName: 'Alice', lastName: 'Johnson', age: undefined}"`; + +exports[`handles complex nested objects with arrays 1`] = ` +"{ + user: { + id: 2, + details: { + name: 'Bob', + hobbies: [ + 'skiing', + 'cycling' + ] + } + } +}" +`; + +exports[`properly escapes strings when necessary 1`] = `"{complexString: "She said, \\"That's \`incredible\`!\\""}"`; + +exports[`serializes simple objects without quotes on keys where possible 1`] = `"{id: 1, name: 'Alice', isActive: true}"`; + +exports[`switches to backticks when single quotes are in the string 1`] = `"{message: \`It's a wonderful day!\`}"`; + +exports[`uses double quotes when backticks and single quotes are present 1`] = `"{quote: "\`This\` is 'awesome'!"}"`; + +exports[`uses single quotes for strings by default 1`] = `"{greeting: 'Hello, world!'}"`;