Forest Logo
search
package_2

jest-mock

By @eyycheev

Roblox

Mirrored

jest-mock

Upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-mock

This package implements the various function and module mocking capabilities used by Jest. You can find its documentation in the Jest documentation.


:pencil2: Notes

  • As of right now, only a minimal set of functionality for jest-mock has been ported. The only externally facing functions that are supported are:
    • Creating an instance of the ModuleMockerClass via constructor (i.e. importing jest-mock and calling .new() on the import)
    • And then these functions are supported on an instance of the ModuleMockerClass:
      • fn() - create a function that can help in unit testing to confirm expectations on number of calls, returns, call arguments, etc. (currently this is mainly useful for the spyMatchers)
      • clearAllMocks()
      • resetAllMocks()
      • restoreAllMocks()

Package Details

Install command (Click to copy)


Version

3.14.0-rbx.2

License

MIT

check_circle

Safe for commercial use

infoThe package archive does not include its license text; the license is declared in its manifest metadata.

Automated license review — not legal advice.