If false, each call to require() or import() generates a new mock module. If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache.
interface
test.default.MockModuleOptions
interface MockModuleOptions
- cache?: boolean
- exports?: object
Optional mocked exports. The
defaultproperty, if provided, is used as the mocked module's default export. All other own enumerable properties are used as named exports. This option cannot be used withdefaultExportornamedExports.- If the mock is a CommonJS or builtin module,
exports.defaultis used as the value ofmodule.exports. - If
exports.defaultis not provided for a CommonJS or builtin mock,module.exportsdefaults to an empty object. - If named exports are provided with a non-object default export, the mock throws an exception when used as a CommonJS or builtin module.
- If the mock is a CommonJS or builtin module,