@jest/reporters

  • Version 27.1.0
  • Published
  • 103 kB
  • 24 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?: any
          ) => Promise<void> | void;

            method onRunStart

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

              method onTestCaseResult

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

                method onTestResult

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

                  method onTestStart

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

                    class CoverageReporter

                    class CoverageReporter extends BaseReporter {}

                      constructor

                      constructor(globalConfig: any, options?: CoverageReporterOptions);

                        property filename

                        static readonly filename: string;

                          method onRunComplete

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

                            method onTestResult

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

                              class DefaultReporter

                              class DefaultReporter extends BaseReporter {}

                                constructor

                                constructor(globalConfig: any);

                                  property filename

                                  static readonly filename: string;

                                    method forceFlushBufferedOutput

                                    forceFlushBufferedOutput: () => void;

                                      method onRunComplete

                                      onRunComplete: () => void;

                                        method onRunStart

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

                                          method onTestCaseResult

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

                                            method onTestResult

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

                                              method onTestStart

                                              onTestStart: (test: Test) => void;

                                                method printTestFileFailureMessage

                                                printTestFileFailureMessage: (_testPath: any, _config: any, result: any) => void;

                                                  method printTestFileHeader

                                                  printTestFileHeader: (_testPath: any, config: any, result: any) => void;

                                                    method testFinished

                                                    testFinished: (config: any, testResult: any, aggregatedResults: any) => void;

                                                      class NotifyReporter

                                                      class NotifyReporter extends BaseReporter {}

                                                        constructor

                                                        constructor(
                                                        globalConfig: any,
                                                        startRun: (globalConfig: any) => unknown,
                                                        context: TestSchedulerContext
                                                        );

                                                          property filename

                                                          static readonly filename: string;

                                                            method onRunComplete

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

                                                              class SummaryReporter

                                                              class SummaryReporter extends BaseReporter {}

                                                                constructor

                                                                constructor(globalConfig: any);

                                                                  property filename

                                                                  static readonly filename: string;

                                                                    method onRunComplete

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

                                                                      method onRunStart

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

                                                                        class VerboseReporter

                                                                        class VerboseReporter extends DefaultReporter {}

                                                                          constructor

                                                                          constructor(globalConfig: any);

                                                                            property filename

                                                                            static readonly filename: string;

                                                                              method filterTestResults

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

                                                                                method groupTestsBySuites

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

                                                                                  method onTestResult

                                                                                  onTestResult: (test: Test, result: any, aggregatedResults: any) => 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 (24)

                                                                                                              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>