Package Exports
- @rbxts-js/jest-mock
- @rbxts-js/jest-mock/src/init.lua
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts-js/jest-mock) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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.
✏️ 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
ModuleMockerClassvia 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()
- Creating an instance of the