Suite.d.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. */
  8. import { Config } from '@jest/types';
  9. import expectationResultFactory from '../expectationResultFactory';
  10. import { QueueableFn } from '../queueRunner';
  11. import Spec from './Spec';
  12. export declare type SuiteResult = {
  13. id: string;
  14. description: string;
  15. fullName: string;
  16. failedExpectations: Array<ReturnType<typeof expectationResultFactory>>;
  17. testPath: Config.Path;
  18. status?: string;
  19. };
  20. export declare type Attributes = {
  21. id: string;
  22. parentSuite?: Suite;
  23. description: string;
  24. throwOnExpectationFailure?: boolean;
  25. getTestPath: () => Config.Path;
  26. };
  27. export default class Suite {
  28. id: string;
  29. parentSuite?: Suite;
  30. description: string;
  31. throwOnExpectationFailure: boolean;
  32. beforeFns: Array<QueueableFn>;
  33. afterFns: Array<QueueableFn>;
  34. beforeAllFns: Array<QueueableFn>;
  35. afterAllFns: Array<QueueableFn>;
  36. disabled: boolean;
  37. children: Array<Suite | Spec>;
  38. result: SuiteResult;
  39. sharedContext?: object;
  40. markedPending: boolean;
  41. markedTodo: boolean;
  42. isFocused: boolean;
  43. constructor(attrs: Attributes);
  44. getFullName(): string;
  45. disable(): void;
  46. pend(_message?: string): void;
  47. beforeEach(fn: QueueableFn): void;
  48. beforeAll(fn: QueueableFn): void;
  49. afterEach(fn: QueueableFn): void;
  50. afterAll(fn: QueueableFn): void;
  51. addChild(child: Suite | Spec): void;
  52. status(): "disabled" | "pending" | "failed" | "finished";
  53. isExecutable(): boolean;
  54. canBeReentered(): boolean;
  55. getResult(): SuiteResult;
  56. sharedUserContext(): object;
  57. clonedSharedUserContext(): object;
  58. onException(...args: Parameters<Spec['onException']>): void;
  59. addExpectationResult(...args: Parameters<Spec['addExpectationResult']>): void;
  60. execute(..._args: Array<any>): void;
  61. }
  62. //# sourceMappingURL=Suite.d.ts.map