Files
RSSHub/lib/api/radar/rules/one.test.ts
T
Tony cb0791cb41 perf: dx (#22478)
* perf: use only one WASM alloc for xxhash

* perf(deps): lazy load mercury-parser and use googleapis/youtube instead of heavy googleapis

* perf(dx): lazy load dev registry

speed up npm dev script

* perf: close playwright browser on destroy

* fix: show exception msg in prod

* revert: "perf: use only one WASM alloc for xxhash"

This reverts commit 01ecdd48d09a046dce05f440814dcbec0323a7de.

* perf: use only one WASM alloc for xxhash

* test: add claim for worker

* fix: missing piece from 8dd9c9a

* feat: add namespace to the chunkfilename

* fix: keep var naming
2026-07-09 02:37:41 +08:00

24 lines
699 B
TypeScript

import type { Next } from 'hono';
import { describe, expect, it, vi } from 'vitest';
import { handler } from '@/api/radar/rules/one';
const noopNext: Next = () => Promise.resolve();
describe('api/radar/rules/one', () => {
it('returns radar data for a domain param', async () => {
const ctx = {
req: {
valid: vi.fn(() => ({ domain: 'unknown.invalid' })),
},
json: vi.fn((value) => value),
};
const result = await handler(ctx as any, noopNext);
expect(ctx.req.valid).toHaveBeenCalledWith('param');
expect(ctx.json).toHaveBeenCalledWith(undefined);
expect(result).toBeUndefined();
});
});