SpyStrategy.d.ts 695 B

12345678910111213141516171819202122
  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. export default class SpyStrategy {
  9. identity: () => string;
  10. exec: (...args: Array<any>) => unknown;
  11. callThrough: () => unknown;
  12. returnValue: (value: unknown) => unknown;
  13. returnValues: () => unknown;
  14. throwError: (something: string | Error) => unknown;
  15. callFake: (fn: Function) => unknown;
  16. stub: (fn: Function) => unknown;
  17. constructor({ name, fn, getSpy, }?: {
  18. name?: string;
  19. fn?: Function;
  20. getSpy?: () => unknown;
  21. });
  22. }