From 6061a91e0374195737e79ed84cc899fe685751b5 Mon Sep 17 00:00:00 2001 From: Oleksii Kvasov <45906197+itev4n7@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:41:08 +0100 Subject: [PATCH] Added fixes into code example in fs/_index.md and fs/file/_index.md (#1713) * Added fix into code example in _index.md * added fix of code example in file/_index.md --- .../v0.53.x/javascript-api/k6-experimental/fs/_index.md | 6 +++--- .../javascript-api/k6-experimental/fs/file/_index.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sources/v0.53.x/javascript-api/k6-experimental/fs/_index.md b/docs/sources/v0.53.x/javascript-api/k6-experimental/fs/_index.md index 122fa81a23..5d6b8544ac 100644 --- a/docs/sources/v0.53.x/javascript-api/k6-experimental/fs/_index.md +++ b/docs/sources/v0.53.x/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/v0.53.x/javascript-api/k6-experimental/fs/file/_index.md b/docs/sources/v0.53.x/javascript-api/k6-experimental/fs/file/_index.md index f91d7b8266..828e95e7af 100644 --- a/docs/sources/v0.53.x/javascript-api/k6-experimental/fs/file/_index.md +++ b/docs/sources/v0.53.x/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); } ```