MCPcopy Create free account
hub / github.com/BridgeAR/safe-stable-stringify / assertCircularOutput

Function assertCircularOutput

test.js:245–251  ·  view source on GitHub ↗

* @param {import('tap').Test} assert * @param {ReturnType } serializer * @param {object} value * @param {object} expected * @param {string[]} keys

(assert, serializer, value, expected, keys)

Source from the content-addressed store, hash-verified

243 * @param {string[]} keys
244 */
245function assertCircularOutput (assert, serializer, value, expected, keys) {
246 for (const replacer of [undefined, identityReplacer, keys]) {
247 for (const space of [undefined, 2]) {
248 assert.equal(serializer(value, replacer, space), JSON.stringify(expected, null, space))
249 }
250 }
251}
252
253test('circular markers report ancestor depth in every serialization mode', /** @param {import('tap').Test} assert */ (assert) => {
254 const root = { child: { array: [] } }

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected