MockModuleOptions
type MockModuleOptions = MockModuleOptions| Assembly | Xantham.Fable.Node |
Properties
abstract member cache: bool option with get, set
abstract member cache: bool option with get, setIf 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.
abstract member defaultExport: obj option with get, set
abstract member defaultExport: obj option with get, setThe value to use as the mocked module's default export.
If this value is not provided, ESM mocks do not include a default export. If the mock is a CommonJS or builtin module, this setting is used as the value of module.exports. If this value is not provided, CJS and builtin mocks use an empty object as the value of module.exports.
abstract member namedExports: obj option with get, set
abstract member namedExports: obj option with get, setAn object whose keys and values are used to create the named exports of the mock module.
If the mock is a CommonJS or builtin module, these values are copied onto module.exports. Therefore, if a mock is created with both named exports and a non-object default export, the mock will throw an exception when used as a CJS or builtin module.