Skip to content

Invent convenient types for referencing ReporterOptions' nested properties #40

@noomorph

Description

@noomorph

Currently, it's hard to type separately options.testCase.description , etc.

I have to use clumsy constructs like:

import type {
  TestCaseCustomizer,
  TestCaseExtractorContext,
  TestFileExtractorContext,
  TestRunExtractorContext,
} from 'jest-allure2-reporter';

type TestCaseLikeContext =
  | TestCaseExtractorContext
  | TestFileExtractorContext
  | TestRunExtractorContext;

export const descriptionHtml: TestCaseCustomizer<TestCaseLikeContext>['descriptionHtml'] =
  async ({ $, result }) => {
    return $.markdown2html(result.description);
  };

Isn't that too much? 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions