test('Before all', function (t) { t.plan(1) server = new FakeUploadServer() server.listen(function () { t.ok(server) }) })
test('prototype properties are not logged', async ({ is }) => { const stream = sink() const instance = pino(stream) instance.info(Object.create({ hello: 'world' })) const { hello } = await once(stream, 'data') is(hello, undefined) })
test('clinic bubbleprof --version', function (t) { cli({}, ['clinic', 'bubbleprof', '--version'], function (err, stdout) { t.ifError(err) t.strictEqual( stdout, `v${require('@nearform/bubbleprof/package.json').version}\n` ) t.end() }) })
test('correctly strip undefined when returned from toJSON', async ({ is }) => { const stream = sink() const instance = pino({ test: 'this' }, stream) instance.fatal({ test: { toJSON () { return undefined } } }) const result = await once(stream, 'data') is('test' in result, false) })
test('clinic flame -v', function (t) { cli({}, ['clinic', 'flame', '-v'], function (err, stdout) { t.ifError(err) t.strictEqual( stdout, `v${require('@nearform/flame/version')}\n` ) t.end() }) })
test('clinic doctor - should accept full path to node.js', function (t) { cli({}, ['clinic', 'doctor', '--no-open', '--', process.execPath, '-e', 'setTimeout(() => {}, 10)'], function (err, stdout) { t.ifError(err) t.ok(/Generated HTML file is (.*?)\.clinic[/\\](\d+).clinic-doctor/.test(stdout)) t.end() }) })
test('correctly log Infinity', async (t) => { const stream = sink() const instance = pino(stream) const o = { num: Infinity } instance.info(o) const { num } = await once(stream, 'data') t.is(num, null) })