@catladder/pipeline
Version:
Panter workflow for cloud CI/CD and DevOps
42 lines (41 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var createArtifactsConfig_1 = require("../createArtifactsConfig");
describe("createArtifactsConfig", function () {
it("returns undefined if no artifacts or artifactsReports", function () {
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".")).toBeUndefined();
});
it("returns artifacts if no artifactsReports", function () {
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", undefined, {
paths: ["testpath"],
reports: {
coverage_report: {
coverage_format: "cobertura",
path: "some"
},
terraform: "something"
}
})).toMatchSnapshot();
});
it("returns junit parts of artifactsReports", function () {
expect((0, createArtifactsConfig_1.createArtifactsConfig)(".", {
junit: ["report.xml"]
})).toMatchSnapshot();
});
it("merges junit files if both given", function () {
var _a, _b;
var result = (0, createArtifactsConfig_1.createArtifactsConfig)(".", {
junit: ["partial-report.xml"]
}, {
paths: ["testpath"],
reports: {
junit: "full-report.xml",
terraform: "something"
}
});
expect(result).toMatchSnapshot();
expect((_b = (_a = result === null || result === void 0 ? void 0 : result.artifacts) === null || _a === void 0 ? void 0 : _a.reports) === null || _b === void 0 ? void 0 : _b.junit).toHaveLength(2);
});
});