1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | exports.parseTestPlan = void 0;
|
7 | const fs_1 = __importDefault(require("fs"));
|
8 | const 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 | };
|
25 | exports.parseTestPlan = parseTestPlan;
|
26 |
|
\ | No newline at end of file |