mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
chore(deps): upgrade all dependencies, toolchains and images (#2825)
This commit is contained in:
1 parent
56e04e7b53
commit
3b552e00ef
510 files changed
+23614
-37473
No files matched your search
@@ -51,26 +51,24 @@ describe('AppErrorHandler i18n fallbacks', () => {
|
||||
requestId: undefined,
|
||||
message: 'Internal server error.',
|
||||
},
|
||||
])('$name and logs unexpected errors with request metadata', async ({
|
||||
acceptLanguage,
|
||||
requestLocale,
|
||||
requestId,
|
||||
message,
|
||||
}) => {
|
||||
const errorLogger = vi.spyOn(Logger.prototype, 'error').mockImplementation(() => {});
|
||||
const error = new Error('Private internal failure');
|
||||
const headers = new Headers();
|
||||
if (acceptLanguage !== undefined) {
|
||||
headers.set('accept-language', acceptLanguage);
|
||||
}
|
||||
const response = await createApp(error, requestLocale, requestId).request('/test', {headers});
|
||||
expect(response.status).toBe(500);
|
||||
expect(await response.json()).toEqual({code: APIErrorCodes.INTERNAL_SERVER_ERROR, message});
|
||||
expect(errorLogger).toHaveBeenCalledExactlyOnceWith(
|
||||
{err: error, status: 500, method: 'GET', path: '/test', requestId},
|
||||
'Unhandled error occurred',
|
||||
);
|
||||
});
|
||||
])(
|
||||
'$name and logs unexpected errors with request metadata',
|
||||
async ({acceptLanguage, requestLocale, requestId, message}) => {
|
||||
const errorLogger = vi.spyOn(Logger.prototype, 'error').mockImplementation(() => {});
|
||||
const error = new Error('Private internal failure');
|
||||
const headers = new Headers();
|
||||
if (acceptLanguage !== undefined) {
|
||||
headers.set('accept-language', acceptLanguage);
|
||||
}
|
||||
const response = await createApp(error, requestLocale, requestId).request('/test', {headers});
|
||||
expect(response.status).toBe(500);
|
||||
expect(await response.json()).toEqual({code: APIErrorCodes.INTERNAL_SERVER_ERROR, message});
|
||||
expect(errorLogger).toHaveBeenCalledExactlyOnceWith(
|
||||
{err: error, status: 500, method: 'GET', path: '/test', requestId},
|
||||
'Unhandled error occurred',
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it('localizes FluxerError responses without an i18n service and logs them as expected rejections', async () => {
|
||||
const errorLogger = vi.spyOn(Logger.prototype, 'error').mockImplementation(() => {});
|
||||
|
||||
Reference in new issue
Block a user