Skip to content

Commit 29973ef

Browse files
committed
fix format
1 parent 8b7c208 commit 29973ef

5 files changed

Lines changed: 36 additions & 10 deletions

File tree

packages/cli/test/commands/agent.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ describe("agent command", () => {
523523
command: "npm test",
524524
error: expect.any(AgentExpectationUsageError),
525525
});
526-
expect(consoleModule.error).toHaveBeenCalledWith("Use either --expectations <file> or inline expectation flags, not both");
526+
expect(consoleModule.error).toHaveBeenCalledWith(
527+
"Use either --expectations <file> or inline expectation flags, not both",
528+
);
527529
expect(executeAllureRun).not.toHaveBeenCalled();
528530
expect(exitMock).toHaveBeenCalledWith(1);
529531
});

packages/plugin-agent/src/inline-expectations.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,14 @@ export const buildAgentInlineExpectations = (
147147
addLabelValues(expectedLabels, options.expectLabels, "--expect-label");
148148
addLabelValues(forbiddenLabels, options.forbidLabels, "--forbid-label");
149149

150-
const expectTests = readNonNegativeInteger(readSingleStringOption(options.expectTests, "--expect-tests"), "--expect-tests");
151-
const expectSteps = readPositiveInteger(readSingleStringOption(options.expectSteps, "--expect-steps"), "--expect-steps");
150+
const expectTests = readNonNegativeInteger(
151+
readSingleStringOption(options.expectTests, "--expect-tests"),
152+
"--expect-tests",
153+
);
154+
const expectSteps = readPositiveInteger(
155+
readSingleStringOption(options.expectSteps, "--expect-steps"),
156+
"--expect-steps",
157+
);
152158
const expectAttachments = readPositiveInteger(
153159
readSingleStringOption(options.expectAttachments, "--expect-attachments"),
154160
"--expect-attachments",

packages/plugin-agent/src/query.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ import { join } from "node:path";
44
import type { TestLabel, TestStatus } from "@allurereport/core-api";
55

66
import { AgentUsageError } from "./errors.js";
7-
import type { AgentFindingCategory, AgentFindingSeverity, AgentOutputBundle, AgentTestManifestLine } from "./harness.js";
7+
import type {
8+
AgentFindingCategory,
9+
AgentFindingSeverity,
10+
AgentOutputBundle,
11+
AgentTestManifestLine,
12+
} from "./harness.js";
813
import type { AgentLabelFilter } from "./selection.js";
914

1015
export const AGENT_QUERY_SCHEMA = "allure-agent-query/v1";
1116
export const AGENT_QUERY_VIEWS = ["summary", "tests", "findings", "test"] as const;
1217
export const AGENT_TEST_STATUSES: TestStatus[] = ["failed", "broken", "unknown", "skipped", "passed"];
1318
export const AGENT_FINDING_SEVERITIES: AgentFindingSeverity[] = ["high", "warning", "info"];
14-
export const AGENT_FINDING_CATEGORIES: AgentFindingCategory[] = ["bootstrap", "scope", "metadata", "evidence", "smells"];
19+
export const AGENT_FINDING_CATEGORIES: AgentFindingCategory[] = [
20+
"bootstrap",
21+
"scope",
22+
"metadata",
23+
"evidence",
24+
"smells",
25+
];
1526

1627
export type AgentQueryView = (typeof AGENT_QUERY_VIEWS)[number];
1728

@@ -213,7 +224,9 @@ const buildAgentQueryTestPayload = async (output: AgentOutputBundle, filters: Ag
213224
}
214225

215226
if (matched.length > 1) {
216-
throw new AgentUsageError(`Query matched ${matched.length} tests in ${output.outputDir}. Use --test <full-name-or-id>.`);
227+
throw new AgentUsageError(
228+
`Query matched ${matched.length} tests in ${output.outputDir}. Use --test <full-name-or-id>.`,
229+
);
217230
}
218231

219232
const test = matched[0];

packages/plugin-agent/src/selection.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { join, resolve } from "node:path";
55
import type { TestLabel, TestPlan, TestPlanTest } from "@allurereport/core-api";
66

77
import { AgentUsageError } from "./errors.js";
8-
import { loadAgentOutput, planAgentEnrichmentReview, type AgentOutputBundle, type AgentTestManifestLine } from "./harness.js";
8+
import {
9+
loadAgentOutput,
10+
planAgentEnrichmentReview,
11+
type AgentOutputBundle,
12+
type AgentTestManifestLine,
13+
} from "./harness.js";
914
import { readLatestAgentState } from "./state.js";
1015

1116
export type AgentRerunPreset = "review" | "failed" | "unsuccessful" | "all";

packages/plugin-agent/test/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,9 @@ describe("AgentPlugin", () => {
769769
expect(content).toContain("missing attachment");
770770
expect(content).toContain("screenshot.png");
771771
expect(content).toContain("fixture.log");
772-
expect(
773-
await readText(join(outputDir, "tests", "default", "artifact-history.assets", "screenshot.png")),
774-
).toBe("png-bytes");
772+
expect(await readText(join(outputDir, "tests", "default", "artifact-history.assets", "screenshot.png"))).toBe(
773+
"png-bytes",
774+
);
775775
expect(await readText(join(outputDir, "tests", "default", "artifact-history.assets", "fixture.log"))).toBe(
776776
"fixture log",
777777
);

0 commit comments

Comments
 (0)