Repository: facebook/jest
File: packages/jest-environment/src/index.ts (TypeScript)

Code before:
   */
  isolateModules(fn: () => void): Jest;
  /**
   * `jest.isolateModulesAsync()` is the equivalent of `jest.isolateModules()`, but for
   * async functions to be wrapped. The caller is expected to `await` the completion of
   * `isolateModulesAsync`.
   */
  isolateModulesAsync(fn: () => Promise<void>): Promise<void>;
  /**
   * Mocks a module with an auto-mocked version when it is being required.
   */
  mock<T = unknown>(
    moduleName: string,
    moduleFactory?: () => T,
    options?: {virtual?: boolean},
  ): Jest;
  /**
   * Registers a callback function that is invoked whenever a mock is generated for a module.
   * This callback is passed the module name and the newly created mock object, and must return
   * the (potentially modified) mock object.
   *
   * If multiple callbacks are registered, they will be called in the order they were added.
   * Each callback receives the result of the previous callback as the `moduleMock` parameter,
   * making it possible to apply sequential transformations.
   *
   * @param cb
   */
  onGenerateMock<T>(cb: (moduleName: string, moduleMock: T) => T): Jest;
  /**
   * Mocks a module with the provided module factory when it is being imported.
   */
  unstable_mockModule<T = unknown>(
    moduleName: string,
    moduleFactory: () => T | Promise<T>,
    options?: {virtual?: boolean},
  ): Jest;
  /**
   * Wraps types of the `source` object and its deep members with type definitions
   * of Jest mock function. Pass `{shallow: true}` option to disable the deeply
   * mocked behavior.
   */
  mocked: ModuleMocker['mocked'];
  /**
   * Returns the current time in ms of the fake timer clock.
   */
  now(): number;
  /**
   * Replaces property on an object with another value.
   *
   * @remarks
   * For mocking functions or 'get' or 'set' accessors, use `jest.spyOn()` instead.

Review comment (suggestion):
This line looks redundant, or?

```suggestion
```

Code after:
   */
  isolateModules(fn: () => void): Jest;
  /**
   * `jest.isolateModulesAsync()` is the equivalent of `jest.isolateModules()`, but for
   * async functions to be wrapped. The caller is expected to `await` the completion of
   * `isolateModulesAsync`.
   */
  isolateModulesAsync(fn: () => Promise<void>): Promise<void>;
  /**
   * Mocks a module with an auto-mocked version when it is being required.
   */
  mock<T = unknown>(
    moduleName: string,
    moduleFactory?: () => T,
    options?: {virtual?: boolean},
  ): Jest;
  /**
   * Mocks a module with the provided module factory when it is being imported.
   */
  unstable_mockModule<T = unknown>(
    moduleName: string,
    moduleFactory: () => T | Promise<T>,
    options?: {virtual?: boolean},
  ): Jest;
  /**
   * Wraps types of the `source` object and its deep members with type definitions
   * of Jest mock function. Pass `{shallow: true}` option to disable the deeply
   * mocked behavior.
   */
  mocked: ModuleMocker['mocked'];
  /**
   * Returns the current time in ms of the fake timer clock.
   */
  now(): number;
  /**
   * Registers a callback function that is invoked whenever a mock is generated for a module.
   * This callback is passed the module name and the newly created mock object, and must return
   * the (potentially modified) mock object.
   *
   * If multiple callbacks are registered, they will be called in the order they were added.
   * Each callback receives the result of the previous callback as the `moduleMock` parameter,
   * making it possible to apply sequential transformations.
   */
  onGenerateMock<T>(cb: (moduleName: string, moduleMock: T) => T): Jest;
  /**
   * Replaces property on an object with another value.
   *
   * @remarks
   * For mocking functions or 'get' or 'set' accessors, use `jest.spyOn()` instead.
   */
  replaceProperty: ModuleMocker['replaceProperty'];