wix-incubator / jest-allure2-reporter

🦉📊 Idiomatic Jest reporter for Allure Framework
https://wix-incubator.github.io/jest-allure2-reporter/
MIT License
9 stars 0 forks source link

Invent convenient types for referencing ReporterOptions' nested properties #40

Open noomorph opened 4 months ago

noomorph commented 4 months ago

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? 🤔