Skip to content

Commit f956d87

Browse files
committed
doc: improve mock.module example clarity
Rename the named export in the mock.module() example from `fn` to `foo` for improved readability.
1 parent 0498de3 commit f956d87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,10 +2465,10 @@ The following example demonstrates how a mock is created for a module.
24652465

24662466
```js
24672467
test('mocks a builtin module in both module systems', async (t) => {
2468-
// Create a mock of 'node:readline' with a named export named 'fn', which
2468+
// Create a mock of 'node:readline' with a named export named 'foo', which
24692469
// does not exist in the original 'node:readline' module.
24702470
const mock = t.mock.module('node:readline', {
2471-
exports: { fn() { return 42; } },
2471+
exports: { foo: () => 42 },
24722472
});
24732473

24742474
let esmImpl = await import('node:readline');

0 commit comments

Comments
 (0)