mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 11:13:21 +00:00
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>
28 lines
884 B
TypeScript
28 lines
884 B
TypeScript
import { describe, expect, inject, it } from "vitest";
|
|
import {
|
|
LONG_RUNNING_DEADLINE_MS,
|
|
TEST_DEADLINE_MS,
|
|
} from "../../support/testDeadlines.js";
|
|
|
|
// These probes read the deadline Vitest collected, so they fail if project
|
|
// inheritance or tag resolution stops applying the configured policy.
|
|
const scale = inject("testDeadlineScale");
|
|
|
|
it("applies the built project deadline to an untagged test", ({ task }) => {
|
|
expect(task.timeout).toBe(TEST_DEADLINE_MS.built * scale);
|
|
});
|
|
|
|
it(
|
|
"applies the long-running deadline to a tagged test",
|
|
{ tags: ["long-running"] },
|
|
({ task }) => {
|
|
expect(task.timeout).toBe(LONG_RUNNING_DEADLINE_MS * scale);
|
|
},
|
|
);
|
|
|
|
describe("a long-running suite", { tags: ["long-running"] }, () => {
|
|
it("passes the long-running deadline to its tests", ({ task }) => {
|
|
expect(task.timeout).toBe(LONG_RUNNING_DEADLINE_MS * scale);
|
|
});
|
|
});
|