MCPcopy
hub / github.com/jestjs/jest / serialize

Function serialize

packages/jest-snapshot/src/utils.ts:59–72  ·  view source on GitHub ↗
(
  val: unknown,
  indent = 2,
  formatOverrides: PrettyFormatOptions = {},
)

Source from the content-addressed store, hash-verified

57const printFunctionName = false;
58
59export const serialize = (
60 val: unknown,
61 indent = 2,
62 formatOverrides: PrettyFormatOptions = {},
63): string =>
64 normalizeNewlines(
65 prettyFormat(val, {
66 escapeRegex,
67 indent,
68 plugins: getSerializers(),
69 printFunctionName,
70 ...formatOverrides,
71 }),
72 );
73
74export const minify = (val: unknown): string =>
75 prettyFormat(val, {

Callers 9

matchMethod · 0.90
printSnapshotAndReceivedFunction · 0.90
testWithStringifyFunction · 0.90
utils.test.tsFile · 0.90
packMessageFunction · 0.50
_persistMethod · 0.50
utils.jsFile · 0.50
snapshot.test.jsFile · 0.50

Calls 2

normalizeNewlinesFunction · 0.90
getSerializersFunction · 0.90

Tested by 1

testWithStringifyFunction · 0.72