diff --git a/test/common/README.md b/test/common/README.md index c75792bf4978b6..5d20e34aa83646 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -312,15 +312,15 @@ Use of this function is encouraged for relevant regression tests and for new APIs that work with user-provided objects. ```mjs -import { promises as fs } from 'node:fs'; +import { open } from 'node:fs/promises'; import { mustNotMutate } from '../common/index.mjs'; const _mutableOptions = { length: 4, position: 8 }; const options = mustNotMutate(_mutableOptions); -// In filehandle.read or filehandle.write attempt to mutate options will throw +// In filehandle.read or filehandle.write, attempt to mutate options will throw // In the test code, options can still be mutated via _mutableOptions -const fh = await fs.open('/path/to/file', 'r+'); +const fh = await open('/path/to/file', 'r+'); const { buffer } = await fh.read(options); _mutableOptions.position = 4; await fh.write(buffer, options);