MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / formatJson

Function formatJson

src/helpers/format-element.ts:63–73  ·  view source on GitHub ↗
(
  json: JsonNode | JsonNode[],
  { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},
)

Source from the content-addressed store, hash-verified

61}
62
63export function formatJson(
64 json: JsonNode | JsonNode[],
65 { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},
66) {
67 return prettyFormat(json, {
68 plugins: [getElementJsonPlugin(mapProps), plugins.ReactElement],
69 highlight: highlight,
70 printBasicPrototype: false,
71 min: compact,
72 });
73}
74
75function getElementJsonPlugin(mapProps?: MapPropsFunction | null): NewPlugin {
76 return {

Callers 2

formatErrorMessageFunction · 0.90
debugFunction · 0.90

Calls 1

getElementJsonPluginFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…