MCPcopy Create free account
hub / github.com/unconed/TermKit / testMisc

Function testMisc

Node/test.js:307–322  ·  view source on GitHub ↗

* Test misc utilties.

(assert)

Source from the content-addressed store, hash-verified

305 * Test misc utilties.
306 */
307function testMisc(assert) {
308 assert(misc.JSONPretty({}) == '{ \n} ', 'Pretty print {}');
309 assert(misc.JSONPretty([]) == '[ \n] ', 'Pretty print []');
310
311 assert(misc.JSONPretty({'foo':'bar', 'baz':'bam'})
312 == '{ \n "foo": "bar", \n "baz": "bam"\n} ',
313 'Pretty print object');
314
315 assert(misc.JSONPretty({foo: {baz:'bam'}, faz: {baz:'bam'}})
316 == '{ \n "foo": { \n "baz": "bam"\n } , \n "faz": { \n "baz": "bam"\n }\n} ',
317 'Pretty print nested objects');
318
319 assert(misc.JSONPretty(['baz', {'foo':'bar'}, 12.3, 'aaa'])
320 == '[ \n "baz", \n { \n "foo": "bar"\n } , \n 12.3, \n "aaa"\n] ',
321 'Pretty print array');
322}
323
324function mockPipes() {
325

Callers

nothing calls this directly

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected