Files
reverse-engineering-anything/tests/evaluation/testDeadlines.test.ts
T
87743d67f5 test: check the deadlines Vitest applies to collected tests
Probes in a source and a built project read each collected test's
deadline, including test, suite, and module long-running tags, so a
change in project inheritance or tag resolution fails directly. Both
the policy and the probes read one set of base deadlines.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 05:27:07 +08:00

17 lines
562 B
TypeScript

import { expect, inject, it } from "vitest";
import {
COVERAGE_DEADLINE_SCALE,
HOSTED_RUNNER_DEADLINE_SCALE,
TEST_DEADLINE_MS,
} from "../support/testDeadlines.js";
it("applies the source project deadline, scaled by coverage and hosted runners", ({
task,
}) => {
const scale = inject("testDeadlineScale");
const coverage = [1, COVERAGE_DEADLINE_SCALE];
const hosted = [1, HOSTED_RUNNER_DEADLINE_SCALE];
expect(coverage.flatMap((c) => hosted.map((h) => c * h))).toContain(scale);
expect(task.timeout).toBe(TEST_DEADLINE_MS.source * scale);
});