jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
41 lines • 1.22 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllureMetadataProxy = void 0;
const constants_1 = require("../constants");
class AllureMetadataProxy {
$metadata;
constructor(metadata) {
this.$metadata = metadata;
}
get id() {
return this.$metadata.id;
}
get(path, fallbackValue) {
const fullPath = this.$localPath(path);
return this.$metadata.get(fullPath, fallbackValue);
}
set(path, value) {
const fullPath = this.$localPath(path);
this.$metadata.set(fullPath, value);
return this;
}
push(key, values) {
const path = this.$localPath(key);
this.$metadata.push(path, values);
return this;
}
assign(values) {
this.$metadata.assign(this.$localPath(), values);
return this;
}
defaults(values) {
this.$metadata.defaults(this.$localPath(), values);
return this;
}
$localPath(key, ...innerKeys) {
const allKeys = key ? [key, ...innerKeys] : innerKeys;
return [constants_1.PREFIX, ...allKeys];
}
}
exports.AllureMetadataProxy = AllureMetadataProxy;
//# sourceMappingURL=AllureMetadataProxy.js.map