Fix sql formatter crash
This commit is contained in:
parent
a91bd80087
commit
29cdeb0621
|
@ -262,6 +262,14 @@ describe('Test logs', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('With some log options', function () {
|
||||||
|
|
||||||
|
it('Should not crash when enabling `prettify_sql` config', async function () {
|
||||||
|
await server.kill()
|
||||||
|
await server.run({ log: { prettify_sql: true } })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
await cleanupTests([ server ])
|
await cleanupTests([ server ])
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,7 +19,7 @@ const consoleLoggerFormat = format.printf(info => {
|
||||||
if (info.sql) {
|
if (info.sql) {
|
||||||
if (CONFIG.LOG.PRETTIFY_SQL) {
|
if (CONFIG.LOG.PRETTIFY_SQL) {
|
||||||
additionalInfos += '\n' + sqlFormat(info.sql, {
|
additionalInfos += '\n' + sqlFormat(info.sql, {
|
||||||
language: 'sql',
|
language: 'postgresql',
|
||||||
tabWidth: 2
|
tabWidth: 2
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue