Skip to content

Commit 79cc593

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 b26144c commit 79cc593

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

doc/api/test.md

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

25232523
```js
25242524
test('mocks a builtin module in both module systems', async (t) => {
2525-
// Create a mock of 'node:readline' with a named export named 'fn', which
2525+
// Create a mock of 'node:readline' with a named export named 'foo', which
25262526
// does not exist in the original 'node:readline' module.
25272527
const mock = t.mock.module('node:readline', {
2528-
exports: { fn() { return 42; } },
2528+
exports: { foo: () => 42 },
25292529
});
25302530

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

0 commit comments

Comments
 (0)