We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67695cb commit 0795ce0Copy full SHA for 0795ce0
packages/allure-js-commons/src/sdk/reporter/testplan.ts
@@ -1,4 +1,4 @@
1
-import { readFileSync } from "node:fs";
+import { existsSync, readFileSync } from "node:fs";
2
import type { Label } from "../../model.js";
3
import type { TestPlanV1 } from "../types.js";
4
import { allureIdRegexp } from "../utils.js";
@@ -10,6 +10,12 @@ export const parseTestPlan = (): TestPlanV1 | undefined => {
10
return undefined;
11
}
12
13
+ if (!existsSync(testPlanPath)) {
14
+ // eslint-disable-next-line no-console
15
+ console.error("Test plan file is missing. Skipping test plan usage:", testPlanPath);
16
+ return undefined;
17
+ }
18
+
19
try {
20
const file = readFileSync(testPlanPath, "utf8");
21
const testPlan = JSON.parse(file) as TestPlanV1;
0 commit comments