@jest/test-result

  • Version 27.2.5
  • Published
  • 16.9 kB
  • 4 dependencies
  • MIT license

Install

npm i @jest/test-result
yarn add @jest/test-result
pnpm add @jest/test-result

Overview

Overview not available.

Index

Functions

function addResult

addResult: (aggregatedResults: AggregatedResult, testResult: TestResult) => void;

    function buildFailureTestResult

    buildFailureTestResult: (testPath: any, err: any) => TestResult;

      function createEmptyTestResult

      createEmptyTestResult: () => TestResult;

        function formatTestResults

        formatTestResults: (
        results: AggregatedResult,
        codeCoverageFormatter?: CodeCoverageFormatter,
        reporter?: CodeCoverageReporter
        ) => FormattedTestResults;

          function makeEmptyAggregatedTestResult

          makeEmptyAggregatedTestResult: () => AggregatedResult;

            Interfaces

            interface RuntimeTransformResult

            interface RuntimeTransformResult extends TransformTypes.TransformResult {}

              property wrapperLength

              wrapperLength: number;

                Type Aliases

                type AggregatedResult

                type AggregatedResult = AggregatedResultWithoutCoverage & {
                coverageMap?: CoverageMap | null;
                };

                  type AssertionLocation

                  type AssertionLocation = {
                  fullName: string;
                  path: string;
                  };

                    type AssertionResult

                    type AssertionResult = TestResult.AssertionResult;

                      type FailedAssertion

                      type FailedAssertion = {
                      matcherName?: string;
                      message?: string;
                      actual?: unknown;
                      pass?: boolean;
                      passed?: boolean;
                      expected?: unknown;
                      isNot?: boolean;
                      stack?: string;
                      error?: unknown;
                      };

                        type FormattedTestResults

                        type FormattedTestResults = {
                        coverageMap?: CoverageMap | null | undefined;
                        numFailedTests: number;
                        numFailedTestSuites: number;
                        numPassedTests: number;
                        numPassedTestSuites: number;
                        numPendingTests: number;
                        numPendingTestSuites: number;
                        numRuntimeErrorTestSuites: number;
                        numTotalTests: number;
                        numTotalTestSuites: number;
                        snapshot: SnapshotSummary;
                        startTime: number;
                        success: boolean;
                        testResults: Array<FormattedTestResult>;
                        wasInterrupted: boolean;
                        };

                          type Milliseconds

                          type Milliseconds = TestResult.Milliseconds;

                            type SerializableError

                            type SerializableError = TestResult.SerializableError;

                              type SnapshotSummary

                              type SnapshotSummary = {
                              added: number;
                              didUpdate: boolean;
                              failure: boolean;
                              filesAdded: number;
                              filesRemoved: number;
                              filesRemovedList: Array<string>;
                              filesUnmatched: number;
                              filesUpdated: number;
                              matched: number;
                              total: number;
                              unchecked: number;
                              uncheckedKeysByFile: Array<UncheckedSnapshot>;
                              unmatched: number;
                              updated: number;
                              };

                                type Status

                                type Status = AssertionResult['status'];

                                  type Suite

                                  type Suite = {
                                  title: string;
                                  suites: Array<Suite>;
                                  tests: Array<AssertionResult>;
                                  };

                                    type Test

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

                                      type TestCaseResult

                                      type TestCaseResult = AssertionResult;

                                        type TestEvents

                                        type TestEvents = {
                                        'test-file-start': [Test];
                                        'test-file-success': [Test, TestResult];
                                        'test-file-failure': [Test, SerializableError];
                                        'test-case-result': [Config.Path, AssertionResult];
                                        };

                                          type TestFileEvent

                                          type TestFileEvent<T extends keyof TestEvents = keyof TestEvents> = (
                                          eventName: T,
                                          args: TestEvents[T]
                                          ) => unknown;

                                            type TestResult

                                            type TestResult = {
                                            console?: ConsoleBuffer;
                                            coverage?: CoverageMapData;
                                            displayName?: Config.DisplayName;
                                            failureMessage?: string | null;
                                            leaks: boolean;
                                            memoryUsage?: Bytes;
                                            numFailingTests: number;
                                            numPassingTests: number;
                                            numPendingTests: number;
                                            numTodoTests: number;
                                            openHandles: Array<Error>;
                                            perfStats: {
                                            end: Milliseconds;
                                            runtime: Milliseconds;
                                            slow: boolean;
                                            start: Milliseconds;
                                            };
                                            skipped: boolean;
                                            snapshot: {
                                            added: number;
                                            fileDeleted: boolean;
                                            matched: number;
                                            unchecked: number;
                                            uncheckedKeys: Array<string>;
                                            unmatched: number;
                                            updated: number;
                                            };
                                            testExecError?: SerializableError;
                                            testFilePath: Config.Path;
                                            testResults: Array<AssertionResult>;
                                            v8Coverage?: V8CoverageResult;
                                            };

                                              type V8CoverageResult

                                              type V8CoverageResult = Array<{
                                              codeTransformResult: RuntimeTransformResult | undefined;
                                              result: V8Coverage[number];
                                              }>;

                                                Package Files (4)

                                                Dependencies (4)

                                                Dev Dependencies (0)

                                                No dev dependencies.

                                                Peer Dependencies (0)

                                                No peer dependencies.

                                                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/test-result.

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