UNPKG

810 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.parseTestPlan = void 0;
7const fs_1 = __importDefault(require("fs"));
8const parseTestPlan = () => {
9 const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;
10 if (!testPlanPath) {
11 return undefined;
12 }
13 try {
14 const file = fs_1.default.readFileSync(testPlanPath, "utf8");
15 const testPlan = JSON.parse(file);
16 if ((testPlan.tests || []).length === 0) {
17 return undefined;
18 }
19 return testPlan;
20 }
21 catch (e) {
22 return undefined;
23 }
24};
25exports.parseTestPlan = parseTestPlan;
26//# sourceMappingURL=testplan.js.map
\No newline at end of file