Skip to content

Commit

Permalink
fix: omit empty executors and categories
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Nov 6, 2024
1 parent b0f817c commit 9c8ed5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/reporter/JestAllure2Reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {

import { type ReporterConfig, resolveOptions } from '../options';
import { AllureMetadataProxy, MetadataSquasher } from '../metadata';
import { compactArray, FileNavigatorCache, stringifyValues } from '../utils';
import { compactArray, isEmpty, FileNavigatorCache, stringifyValues } from '../utils';
import { type AllureWriter, FileAllureWriter } from '../serialization';
import { log, optimizeForTracing } from '../logger';

Expand Down Expand Up @@ -137,17 +137,17 @@ export class JestAllure2Reporter extends JestMetadataReporter {
this._globalContext = globalContext;

const environment = await reporterConfig.environment(globalContext);
if (environment) {
if (!isEmpty(environment)) {
await allureWriter.writeEnvironmentInfo(stringifyValues(environment));
}

const executor = await reporterConfig.executor(globalContext);
if (executor) {
if (!isEmpty(executor)) {
await allureWriter.writeExecutorInfo(executor);
}

const categories = await reporterConfig.categories(globalContext);
if (categories) {
if (!isEmpty(categories)) {
await allureWriter.writeCategories(categories);
}
}
Expand Down

0 comments on commit 9c8ed5b

Please sign in to comment.