Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

14 lines
515 B
TypeScript

import { describe, it, expect } from 'vitest';
import { makeQuotaHook } from '@/lib/agent/runtime/quota';
describe('quota hook (stub)', () => {
it('does not terminate while budget remains', async () => {
const hook = makeQuotaHook({ remaining: () => 100 });
expect((await hook({} as never))?.terminate).toBeFalsy();
});
it('terminates when budget exhausted', async () => {
const hook = makeQuotaHook({ remaining: () => 0 });
expect((await hook({} as never))?.terminate).toBe(true);
});
});