index.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 { Circus, Global } from '@jest/types';
  8. declare type THook = (fn: Circus.HookFn, timeout?: number) => void;
  9. declare const describe: {
  10. (blockName: Circus.BlockName, blockFn: Circus.BlockFn): void;
  11. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  12. only: {
  13. (blockName: Circus.BlockName, blockFn: Circus.BlockFn): void;
  14. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  15. };
  16. skip: {
  17. (blockName: Circus.BlockName, blockFn: Circus.BlockFn): void;
  18. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  19. };
  20. };
  21. declare const beforeEach: THook;
  22. declare const beforeAll: THook;
  23. declare const afterEach: THook;
  24. declare const afterAll: THook;
  25. declare const test: Global.It;
  26. declare const it: Global.It;
  27. export declare type Event = Circus.Event;
  28. export declare type State = Circus.State;
  29. export { afterAll, afterEach, beforeAll, beforeEach, describe, it, test };
  30. declare const _default: {
  31. afterAll: THook;
  32. afterEach: THook;
  33. beforeAll: THook;
  34. beforeEach: THook;
  35. describe: {
  36. (blockName: string, blockFn: Global.BlockFn): void;
  37. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  38. only: {
  39. (blockName: string, blockFn: Global.BlockFn): void;
  40. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  41. };
  42. skip: {
  43. (blockName: string, blockFn: Global.BlockFn): void;
  44. each: (table: Global.EachTable, ...taggedTemplateData: Global.TemplateData) => (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;
  45. };
  46. };
  47. it: Global.It;
  48. test: Global.It;
  49. };
  50. export default _default;