UNPKG

cypress-xray-plugin

Version:

A Cypress plugin for uploading test results to Xray (test management for Jira)

26 lines (24 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ImportFeatureCommand = void 0; const dedent_1 = require("../../../../util/dedent"); const command_1 = require("../../../command"); class ImportFeatureCommand extends command_1.Command { async computeResult() { this.logger.message("info", `Importing feature file to Xray: ${this.parameters.filePath}`); const importResponse = await this.parameters.xrayClient.importFeature(this.parameters.filePath, { projectId: this.parameters.projectId, projectKey: this.parameters.projectKey, source: this.parameters.source, }); if (importResponse.errors.length > 0) { this.logger.message("warning", (0, dedent_1.dedent)(` ${this.parameters.filePath} Encountered errors during feature file import: ${importResponse.errors.map((error) => `- ${error}`).join("\n")} `)); } return importResponse; } } exports.ImportFeatureCommand = ImportFeatureCommand;