Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options: any) {
super(
options,
new AllureRuntime({ resultsDir: "./out/allure-results" }),
{
labels: {
issue: [/@bug_(.*)/],
epic: [/@feature:(.*)/]
},
exceptionFormatter: function(message) {
return message.replace(/after (\d+)ms/g, function(substr, ms) {
return `after ${Math.round(Number.parseInt(ms) / 1000)}s`;
});
}
}
);
const giw = this.getGlobalInfoWriter();
giw.writeExecutorInfo({
name: "Host 1",
constructor(readonly runner: Mocha.Runner, readonly opts: Mocha.MochaOptions) {
super(runner, opts);
const allureConfig: IAllureConfig = { resultsDir: "allure-results", ...opts.reporterOptions };
this.coreReporter = new AllureReporter(new AllureRuntime(allureConfig));
allure = this.coreReporter.getInterface();
this.runner
.on("suite", this.onSuite.bind(this))
.on("suite end", this.onSuiteEnd.bind(this))
.on("test", this.onTest.bind(this))
.on("pass", this.onPassed.bind(this))
.on("fail", this.onFailed.bind(this))
.on("pending", this.onPending.bind(this));
}
constructor(config: IAllureConfig) {
this.runtime = new AllureRuntime(config);
this.installHooks();
}