ReporterDispatcher.d.ts 1.1 KB

1234567891011121314151617181920212223
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. import type { Reporter, ReporterOnStartOptions } from '@jest/reporters';
  8. import type { AggregatedResult, TestCaseResult, TestResult } from '@jest/test-result';
  9. import type { Test } from 'jest-runner';
  10. import type { Context } from 'jest-runtime';
  11. export default class ReporterDispatcher {
  12. private _reporters;
  13. constructor();
  14. register(reporter: Reporter): void;
  15. unregister(ReporterClass: Function): void;
  16. onTestFileResult(test: Test, testResult: TestResult, results: AggregatedResult): Promise<void>;
  17. onTestFileStart(test: Test): Promise<void>;
  18. onRunStart(results: AggregatedResult, options: ReporterOnStartOptions): Promise<void>;
  19. onTestCaseResult(test: Test, testCaseResult: TestCaseResult): Promise<void>;
  20. onRunComplete(contexts: Set<Context>, results: AggregatedResult): Promise<void>;
  21. getErrors(): Array<Error>;
  22. hasErrors(): boolean;
  23. }