mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
chore(workspace): tighten quality gates (#2230)
This commit is contained in:
1 parent
e6e4c6f7b5
commit
5c2dca1c51
123 files changed
+4925
-5640
No files matched your search
@@ -188,15 +188,23 @@ describe('applyMiddlewareStack', () => {
|
||||
expect(response.headers.get('Cache-Control')).toBeNull();
|
||||
});
|
||||
test('skips errorHandler when skipErrorHandler is true', async () => {
|
||||
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
const error = new Error('Test error');
|
||||
const app = new Hono();
|
||||
applyMiddlewareStack(app, {
|
||||
skipErrorHandler: true,
|
||||
});
|
||||
app.get('/test', () => {
|
||||
throw new Error('Test error');
|
||||
throw error;
|
||||
});
|
||||
const response = await app.request('/test');
|
||||
expect(response.status).toBe(500);
|
||||
try {
|
||||
const response = await app.request('/test');
|
||||
expect(response.status).toBe(500);
|
||||
expect(consoleErrorSpy).toHaveBeenCalledTimes(1);
|
||||
expect(consoleErrorSpy).toHaveBeenCalledWith(error);
|
||||
} finally {
|
||||
consoleErrorSpy.mockRestore();
|
||||
}
|
||||
});
|
||||
test('applies custom middleware', async () => {
|
||||
const customMiddleware = vi.fn().mockImplementation(async (_c, next) => {
|
||||
|
||||
Reference in new issue
Block a user