lint fixes

This commit is contained in:
Ulf Gebhardt 2023-01-31 23:06:57 +01:00
parent 7845ffd8e4
commit be902ae07e
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -4,11 +4,13 @@ import LogError from './LogError'
describe('LogError', () => {
it('logs an Error when created', () => {
/* eslint-disable-next-line no-new */
new LogError('new LogError')
expect(logger.error).toBeCalledWith('new LogError')
})
it('logs an Error including additional data when created', () => {
/* eslint-disable-next-line no-new */
new LogError('new LogError', { some: 'data' })
expect(logger.error).toBeCalledWith('new LogError', { some: 'data' })
})
@ -16,6 +18,7 @@ describe('LogError', () => {
it('does not contain additional data in Error object when thrown', () => {
try {
throw new LogError('new LogError', { someWeirdValue123: 'arbitraryData456' })
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
} catch (e: any) {
expect(e.stack).not.toMatch(/(someWeirdValue123|arbitraryData456)/i)
}