test('sync false does not log everything when calling process.exit(0)', async ({ is }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'syncfalse-exit.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') is(actual.match(/hello/), null) is(actual.match(/world/), null) })
// Bootstrap lando at the correct level lando.bootstrap(bsLevel).then(lando => { // If bootstrap level is APP then we need to get and init our app to generate the app task cache if (bsLevel === 'APP') { lando.getApp().init().then(() => cli.run(bootstrap.getTasks(config, cli.argv()), config)); // Otherwise run as yooz } else { cli.run(bootstrap.getTasks(config, cli.argv()), config); } });
crontab.get_crontab(process.argv[process.argv.length -1 -2], function(job){ var transporter = nodemailer.createTransport(job.mailing.transporterStr); var mailOptions = job.mailing.mailOptions; mailOptions.attachments = [{filename: "stdout.txt", path: process.argv[process.argv.length -1 -1]}, {filename: "stderr.txt", path: process.argv[process.argv.length -1]}]; transporter.sendMail(mailOptions, function(error, info){ if(error){ return console.log(error); } console.log('Message sent: ' + info.response); }); });
explicitVersion(process.argv[2]) .then(null, findLatestVersion) .then(fetchDocs) .then(renderPost) .then(writeToFile) .then((filepath) => { console.log('Release post created:', filepath) }, (err) => { console.error('Some error occurred here!', err.stack) process.exit(1) })
function main() { let n = process.argv[2] || 20 // console.log(buildExtend(n)) console.log(buildInterface(n)) }
test('applies redaction rules', async ({ is, isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'redact.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h/), null) isNot(strip(actual).match(/\[Redacted\]/), null) is(strip(actual).match(/object/), null) })
test('without timestamp', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'no-time.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).slice(2), '[]') })
test('sync false logs everything when calling flushSync', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'syncfalse-flush-exit.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(actual.match(/hello/), null) isNot(actual.match(/world/), null) })
test('with custom timestamp', async ({ is }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'custom-time.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') is(strip(actual).slice(0, 6), '[test]') })
test('final works without prior logging', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'final-no-log-before.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).match(/WARN\s+: pino.final with prettyPrint does not support flushing/), null) isNot(strip(actual).match(/INFO\s+\(123456 on abcdefghijklmnopqr\): beforeExit/), null) })
test('can be enabled via exported pino function', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'basic.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h/), null) })
test('dateformat', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'dateformat.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h/), null) })
test('works as expected with an object with the msg prop', async ({ isNot }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'obj-msg-prop.js')]) child.stdout.pipe(writer((s, enc, cb) => { actual += s cb() })) await once(child, 'close') isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): hello/), null) })