Skip to content

Commit 2466ad5

Browse files
committed
doc: emphasize invalid mock.module option combinations
Bold the `mock.module()` option compatibility notes in the test API docs. This makes the mutual exclusion between `exports`, `defaultExport`, and `namedExports` easier to notice when reading the module mocking options.
1 parent a135c49 commit 2466ad5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/test.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,7 @@ changes:
24862486
* `exports` {Object} Optional mocked exports. The `default` property, if
24872487
provided, is used as the mocked module's default export. All other own
24882488
enumerable properties are used as named exports.
2489-
This option cannot be used with `defaultExport` or `namedExports`.
2489+
**This option cannot be used with `defaultExport` or `namedExports`.**
24902490
* If the mock is a CommonJS or builtin module, `exports.default` is used as
24912491
the value of `module.exports`.
24922492
* If `exports.default` is not provided for a CommonJS or builtin mock,
@@ -2498,15 +2498,15 @@ changes:
24982498
export. If the mock is a CommonJS or builtin module, this setting is used as
24992499
the value of `module.exports`. If this value is not provided, CJS and builtin
25002500
mocks use an empty object as the value of `module.exports`.
2501-
This option cannot be used with `options.exports`.
2501+
**This option cannot be used with `options.exports`.**
25022502
This option is deprecated and will be removed in a later version.
25032503
Prefer `options.exports.default`.
25042504
* `namedExports` {Object} An optional object whose keys and values are used to
25052505
create the named exports of the mock module. If the mock is a CommonJS or
25062506
builtin module, these values are copied onto `module.exports`. Therefore, if a
25072507
mock is created with both named exports and a non-object default export, the
25082508
mock will throw an exception when used as a CJS or builtin module.
2509-
This option cannot be used with `options.exports`.
2509+
**This option cannot be used with `options.exports`.**
25102510
This option is deprecated and will be removed in a later version.
25112511
Prefer `options.exports`.
25122512
* Returns: {MockModuleContext} An object that can be used to manipulate the mock.

0 commit comments

Comments
 (0)