Projektstart
This commit is contained in:
14
backend/node_modules/pino-pretty/lib/utils/prettify-error.test.js
generated
vendored
Normal file
14
backend/node_modules/pino-pretty/lib/utils/prettify-error.test.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
const tap = require('tap')
|
||||
const stringifySafe = require('fast-safe-stringify')
|
||||
const prettifyError = require('./prettify-error')
|
||||
|
||||
tap.test('prettifies error', t => {
|
||||
const error = Error('Bad error!')
|
||||
const lines = stringifySafe(error, Object.getOwnPropertyNames(error), 2)
|
||||
|
||||
const prettyError = prettifyError({ keyName: 'errorKey', lines, ident: ' ', eol: '\n' })
|
||||
t.match(prettyError, /\s*errorKey: {\n\s*"stack":[\s\S]*"message": "Bad error!"/)
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user