From e0ac568f04a2b8aa4b1f0b0da2ef1f2a58a5fa7c Mon Sep 17 00:00:00 2001 From: Jaromir Obr Date: Wed, 4 Oct 2023 16:31:21 +0200 Subject: [PATCH] FileSystem: JSDoc: Fixed a typo in writeToFile(), added a unit test (#3897) * FileSystem: JSDoc: Fixed a typo in writeToFile() * Added a unit test for writeToFile() --- docs/helpers/FileSystem.md | 2 +- lib/helper/FileSystem.js | 2 +- test/unit/helper/FileSystem_test.js | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/helpers/FileSystem.md b/docs/helpers/FileSystem.md index c7dfa0df1..0af9843db 100644 --- a/docs/helpers/FileSystem.md +++ b/docs/helpers/FileSystem.md @@ -140,7 +140,7 @@ I.waitForFile('largeFilesName.txt', 10); // wait 10 seconds for file ### writeToFile -Writes test to file +Writes text to file #### Parameters diff --git a/lib/helper/FileSystem.js b/lib/helper/FileSystem.js index a7d3efb62..830936c7d 100644 --- a/lib/helper/FileSystem.js +++ b/lib/helper/FileSystem.js @@ -52,7 +52,7 @@ class FileSystem extends Helper { } /** - * Writes test to file + * Writes text to file * @param {string} name * @param {string} text */ diff --git a/test/unit/helper/FileSystem_test.js b/test/unit/helper/FileSystem_test.js index 912d5c027..6c2ead30e 100644 --- a/test/unit/helper/FileSystem_test.js +++ b/test/unit/helper/FileSystem_test.js @@ -43,4 +43,12 @@ describe('FileSystem', () => { for FileSystem helper test`); }); + + it('should write text to file', () => { + const outputFilePath = 'data/output/fs_output.txt'; + const text = '123'; + fs.writeToFile(outputFilePath, text); + fs.seeFile(outputFilePath); + fs.seeInThisFile(text); + }); });