Skip to content

Commit

Permalink
fix tests and linters
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed Jan 16, 2025
1 parent 83cc150 commit 511163d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/allure-js-commons/src/sdk/reporter/ReporterRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type Attachment,
type AttachmentOptions,
type FixtureResult,
Label,
type Label,
Stage,
type StepResult,
type TestResult,
Expand All @@ -27,7 +27,6 @@ import { hasSkipLabel } from "./testplan.js";
import type {
FixtureResultWrapper,
FixtureType,
GlobalLabelsConfig,
LinkConfig,
ReporterRuntimeConfig,
TestScope,
Expand Down Expand Up @@ -108,7 +107,14 @@ export class ReporterRuntime {
linkConfig?: LinkConfig;
globalLabels: Label[] = [];

constructor({ writer, listeners = [], environmentInfo, categories, links, globalLabels }: ReporterRuntimeConfig) {
constructor({
writer,
listeners = [],
environmentInfo,
categories,
links,
globalLabels = {},
}: ReporterRuntimeConfig) {
this.writer = resolveWriter(writer);
this.notifier = new Notifier({ listeners });
this.categories = categories;
Expand All @@ -117,8 +123,8 @@ export class ReporterRuntime {

if (Array.isArray(globalLabels)) {
this.globalLabels = globalLabels;
} else if (Object.keys(globalLabels as GlobalLabelsConfig).length) {
this.globalLabels = Object.entries(globalLabels as GlobalLabelsConfig).flatMap(([name, value]) => {
} else if (Object.keys(globalLabels).length) {
this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {
if (Array.isArray(value)) {
return value.map((v) => ({ name, value: v }));
}
Expand Down

0 comments on commit 511163d

Please sign in to comment.