@jest/reporters

  • Version 27.4.6
  • Published
  • 103 kB
  • 25 dependencies
  • MIT license

Install

npm i @jest/reporters
yarn add @jest/reporters
pnpm add @jest/reporters

Overview

Jest's reporters

Index

Variables

variable utils

const utils: {
formatTestPath: (
config:
| import('@jest/types/build/Config').ProjectConfig
| import('@jest/types/build/Config').GlobalConfig,
testPath: string
) => string;
getResultHeader: (
result: any,
globalConfig: any,
projectConfig?: import('@jest/types/build/Config').ProjectConfig | undefined
) => string;
getSummary: (
aggregatedResults: any,
options?: import('./types').SummaryOptions | undefined
) => string;
printDisplayName: (config: any) => string;
relativePath: (
config:
| import('@jest/types/build/Config').ProjectConfig
| import('@jest/types/build/Config').GlobalConfig,
testPath: string
) => { basename: string; dirname: string };
trimAndFormatPath: (
pad: number,
config:
| import('@jest/types/build/Config').ProjectConfig
| import('@jest/types/build/Config').GlobalConfig,
testPath: string,
columns: number
) => string;
};

    Classes

    class BaseReporter

    class BaseReporter implements Reporter {}

      method getLastError

      getLastError: () => Error | undefined;

        method log

        log: (message: string) => void;

          method onRunComplete

          onRunComplete: (
          _contexts?: Set<Context>,
          _aggregatedResults?: AggregatedResult
          ) => Promise<void> | void;

            method onRunStart

            onRunStart: (
            _results?: AggregatedResult,
            _options?: ReporterOnStartOptions
            ) => void;

              method onTestCaseResult

              onTestCaseResult: (_test: Test, _testCaseResult: TestCaseResult) => void;

                method onTestResult

                onTestResult: (
                _test?: Test,
                _testResult?: TestResult,
                _results?: AggregatedResult
                ) => void;

                  method onTestStart

                  onTestStart: (_test?: Test) => void;

                    class CoverageReporter

                    class CoverageReporter extends BaseReporter {}

                      constructor

                      constructor(
                      globalConfig: Config.GlobalConfig,
                      options?: CoverageReporterOptions
                      );

                        property filename

                        static readonly filename: string;

                          method onRunComplete

                          onRunComplete: (
                          contexts: Set<Context>,
                          aggregatedResults: AggregatedResult
                          ) => Promise<void>;

                            method onTestResult

                            onTestResult: (_test: Test, testResult: TestResult) => void;

                              class DefaultReporter

                              class DefaultReporter extends BaseReporter {}

                                constructor

                                constructor(globalConfig: Config.GlobalConfig);

                                  property filename

                                  static readonly filename: string;

                                    method forceFlushBufferedOutput

                                    forceFlushBufferedOutput: () => void;

                                      method onRunComplete

                                      onRunComplete: () => void;

                                        method onRunStart

                                        onRunStart: (
                                        aggregatedResults: AggregatedResult,
                                        options: ReporterOnStartOptions
                                        ) => void;

                                          method onTestCaseResult

                                          onTestCaseResult: (test: Test, testCaseResult: TestCaseResult) => void;

                                            method onTestResult

                                            onTestResult: (
                                            test: Test,
                                            testResult: TestResult,
                                            aggregatedResults: AggregatedResult
                                            ) => void;

                                              method onTestStart

                                              onTestStart: (test: Test) => void;

                                                method printTestFileFailureMessage

                                                printTestFileFailureMessage: (
                                                _testPath: Config.Path,
                                                _config: Config.ProjectConfig,
                                                result: TestResult
                                                ) => void;

                                                  method printTestFileHeader

                                                  printTestFileHeader: (
                                                  _testPath: Config.Path,
                                                  config: Config.ProjectConfig,
                                                  result: TestResult
                                                  ) => void;

                                                    method testFinished

                                                    testFinished: (
                                                    config: Config.ProjectConfig,
                                                    testResult: TestResult,
                                                    aggregatedResults: AggregatedResult
                                                    ) => void;

                                                      class NotifyReporter

                                                      class NotifyReporter extends BaseReporter {}

                                                        constructor

                                                        constructor(
                                                        globalConfig: Config.GlobalConfig,
                                                        startRun: (globalConfig: Config.GlobalConfig) => unknown,
                                                        context: TestSchedulerContext
                                                        );

                                                          property filename

                                                          static readonly filename: string;

                                                            method onRunComplete

                                                            onRunComplete: (contexts: Set<Context>, result: AggregatedResult) => void;

                                                              class SummaryReporter

                                                              class SummaryReporter extends BaseReporter {}

                                                                constructor

                                                                constructor(globalConfig: Config.GlobalConfig);

                                                                  property filename

                                                                  static readonly filename: string;

                                                                    method onRunComplete

                                                                    onRunComplete: (
                                                                    contexts: Set<Context>,
                                                                    aggregatedResults: AggregatedResult
                                                                    ) => void;

                                                                      method onRunStart

                                                                      onRunStart: (
                                                                      aggregatedResults: AggregatedResult,
                                                                      options: ReporterOnStartOptions
                                                                      ) => void;

                                                                        class VerboseReporter

                                                                        class VerboseReporter extends DefaultReporter {}

                                                                          constructor

                                                                          constructor(globalConfig: Config.GlobalConfig);

                                                                            property filename

                                                                            static readonly filename: string;

                                                                              method filterTestResults

                                                                              static filterTestResults: (
                                                                              testResults: Array<AssertionResult>
                                                                              ) => Array<AssertionResult>;

                                                                                method groupTestsBySuites

                                                                                static groupTestsBySuites: (testResults: Array<AssertionResult>) => Suite;

                                                                                  method onTestResult

                                                                                  onTestResult: (
                                                                                  test: Test,
                                                                                  result: TestResult,
                                                                                  aggregatedResults: AggregatedResult
                                                                                  ) => void;

                                                                                    Interfaces

                                                                                    interface Reporter

                                                                                    interface Reporter {}

                                                                                      property getLastError

                                                                                      readonly getLastError: () => Error | void;

                                                                                        property onRunComplete

                                                                                        readonly onRunComplete: (
                                                                                        contexts: Set<Context>,
                                                                                        results: AggregatedResult
                                                                                        ) => Promise<void> | void;

                                                                                          property onRunStart

                                                                                          readonly onRunStart: (
                                                                                          results: AggregatedResult,
                                                                                          options: ReporterOnStartOptions
                                                                                          ) => Promise<void> | void;

                                                                                            property onTestCaseResult

                                                                                            readonly onTestCaseResult?: (
                                                                                            test: Test,
                                                                                            testCaseResult: TestCaseResult
                                                                                            ) => Promise<void> | void;

                                                                                              property onTestFileResult

                                                                                              readonly onTestFileResult?: (
                                                                                              test: Test,
                                                                                              testResult: TestResult,
                                                                                              aggregatedResult: AggregatedResult
                                                                                              ) => Promise<void> | void;

                                                                                                property onTestFileStart

                                                                                                readonly onTestFileStart?: (test: Test) => Promise<void> | void;

                                                                                                  property onTestResult

                                                                                                  readonly onTestResult?: (
                                                                                                  test: Test,
                                                                                                  testResult: TestResult,
                                                                                                  aggregatedResult: AggregatedResult
                                                                                                  ) => Promise<void> | void;

                                                                                                    property onTestStart

                                                                                                    readonly onTestStart?: (test: Test) => Promise<void> | void;

                                                                                                      Type Aliases

                                                                                                      type Context

                                                                                                      type Context = {
                                                                                                      config: Config.ProjectConfig;
                                                                                                      hasteFS: HasteFS;
                                                                                                      moduleMap: ModuleMap;
                                                                                                      resolver: Resolver;
                                                                                                      };

                                                                                                        type ReporterOnStartOptions

                                                                                                        type ReporterOnStartOptions = {
                                                                                                        estimatedTime: number;
                                                                                                        showStatus: boolean;
                                                                                                        };

                                                                                                          type SummaryOptions

                                                                                                          type SummaryOptions = {
                                                                                                          currentTestCases?: Array<{
                                                                                                          test: Test;
                                                                                                          testCaseResult: TestCaseResult;
                                                                                                          }>;
                                                                                                          estimatedTime?: number;
                                                                                                          roundTime?: boolean;
                                                                                                          width?: number;
                                                                                                          };

                                                                                                            type Test

                                                                                                            type Test = {
                                                                                                            context: Context;
                                                                                                            duration?: number;
                                                                                                            path: Config.Path;
                                                                                                            };

                                                                                                              Package Files (8)

                                                                                                              Dependencies (25)

                                                                                                              Dev Dependencies (12)

                                                                                                              Peer Dependencies (1)

                                                                                                              Badge

                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@jest/reporters.

                                                                                                              • Markdown
                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@jest/reporters)
                                                                                                              • HTML
                                                                                                                <a href="https://www.jsdocs.io/package/@jest/reporters"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>