Files
Tony 08a38f0a5e refactor: typing house-keeping (#23074)
* refactor: typing house-keeping

* fix: fix parse date not accepting strict mode

* refactor: use npm package

* fix: address review
2026-08-22 23:58:30 +08:00

25 lines
682 B
TypeScript

import { Context, type Next } from 'hono';
import { describe, expect, it } from 'vitest';
import { config } from '@/config';
import trace from '@/middleware/trace';
describe('trace middleware', () => {
it('skips tracing when debugInfo is disabled', async () => {
const originalDebug = config.debugInfo;
config.debugInfo = '';
let called = false;
const ctx = new Context(new Request('http://localhost/test'));
const next: Next = () => {
called = true;
return Promise.resolve();
};
await trace(ctx, next);
expect(called).toBe(true);
config.debugInfo = originalDebug;
});
});