mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
chore(api): improve log statements (#59992)
This commit is contained in:
committed by
GitHub
parent
464181b3b8
commit
a905083bf8
@@ -170,7 +170,10 @@ describe('errorHandling', () => {
|
||||
url: '/test'
|
||||
});
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(Error('a very bad thing happened'));
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
Error('a very bad thing happened'),
|
||||
'Error in request'
|
||||
);
|
||||
});
|
||||
|
||||
it('should call fastify.log.warn when a bad request error occurs', async () => {
|
||||
@@ -181,7 +184,10 @@ describe('errorHandling', () => {
|
||||
url: '/test-bad-request'
|
||||
});
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(Error('a very bad thing happened'));
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
Error('a very bad thing happened'),
|
||||
'CSRF error in request'
|
||||
);
|
||||
});
|
||||
|
||||
it('should NOT log when a CSRF error is thrown', async () => {
|
||||
|
||||
Reference in New Issue
Block a user