diff --git a/docs/sources/next/javascript-api/k6-experimental/fs/_index.md b/docs/sources/next/javascript-api/k6-experimental/fs/_index.md index 122fa81a23..5d6b8544ac 100644 --- a/docs/sources/next/javascript-api/k6-experimental/fs/_index.md +++ b/docs/sources/next/javascript-api/k6-experimental/fs/_index.md @@ -45,6 +45,9 @@ let file; })(); export default async function () { + // Seek to the beginning of the file + await file.seek(0, SeekMode.Start); + // About information about the file const fileinfo = await file.stat(); if (fileinfo.name != 'bonjour.txt') { @@ -75,9 +78,6 @@ export default async function () { if (totalBytesRead != fileinfo.size) { throw new Error('Unexpected number of bytes read'); } - - // Seek back to the beginning of the file - await file.seek(0, SeekMode.Start); } ``` diff --git a/docs/sources/next/javascript-api/k6-experimental/fs/file/_index.md b/docs/sources/next/javascript-api/k6-experimental/fs/file/_index.md index f91d7b8266..828e95e7af 100644 --- a/docs/sources/next/javascript-api/k6-experimental/fs/file/_index.md +++ b/docs/sources/next/javascript-api/k6-experimental/fs/file/_index.md @@ -35,6 +35,9 @@ let file; })(); export default async function () { + // Seek to the beginning of the file + await file.seek(0, SeekMode.Start); + // About information about the file const fileinfo = await file.stat(); if (fileinfo.name != 'bonjour.txt') { @@ -65,9 +68,6 @@ export default async function () { if (totalBytesRead != fileinfo.size) { throw new Error('Unexpected number of bytes read'); } - - // Seek back to the beginning of the file - await file.seek(0, SeekMode.Start); } ```