UNPKG

gherkin-lint-ts

Version:

Gherkin features linter written in Typescript

39 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.printResults = void 0; function printResults(results) { const testCases = results.map(result => { var _a; return ({ _attributes: { name: result.filePath, }, error: (_a = result.errors) === null || _a === void 0 ? void 0 : _a.map(error => ({ _attributes: { message: error.message, type: "gherkin-lint-error", }, _cdata: `${result.filePath}:${error.line} (${error.rule}) ${error.message}`, })), }); }); const testSuiteReport = { _declaration: { _attributes: { version: "1.0", encoding: "utf-8", }, }, testsuite: { _attributes: { name: "gherkin-lint", }, testcase: testCases, }, }; let convert = require("xml-js"); const xunitXml = convert.js2xml(testSuiteReport, { compact: true, spaces: 4 }); process.stdout.write(xunitXml); } exports.printResults = printResults; //# sourceMappingURL=xunit.js.map