Skip to content

Commit

Permalink
catchall: update comments and rename function meaningfully
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwiniraokarai committed May 10, 2024
1 parent 6f89912 commit a0fecb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dotenv.config({
path: DOT_ENV_FILE_PATH,
});

//Show the environment you're running tests o
//Show the environment you're running tests on
console.log("Loaded env config file: " + DOT_ENV_FILE_PATH +
"\nRunning on environment: " + DOT_ENV_FILE_NAME +
"\nAt: " + process.env.URL
Expand Down
3 changes: 3 additions & 0 deletions tests/test-data/JSONFileParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import fs from "fs";

/*Leverage fs object to read contents of JSON file, then parse it to regular JS object
This process is an overkill for this use-case because the test has to convert the JS object back to JSON
*/
function extractArticlesTestDataFrom(testDataJSONFilePath): Object {
const testDataJSONString = fs.readFileSync(testDataJSONFilePath, "utf8");
return JSON.parse(testDataJSONString);
Expand Down
4 changes: 2 additions & 2 deletions tests/test-data/articles-with-randomized-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This function returns a JS/TS Object (It's not JSON. Clue: The Keys aren't Strin
The resulting JS object is intended to be converted to JSON by the caller before use
*/

function fakerGeneratedArticlesData(): Object{
function generateArticlesDataFromFaker(): Object{
return {
articles:[
{
Expand Down Expand Up @@ -66,4 +66,4 @@ function fakerGeneratedArticlesData(): Object{
Exporting as a "default" on the other hand, allows me to wrap up the function as an object
Plus, the importer does not have to worry about the specifics to import. And can look up callable elements using the default exported object
*/
export default {fakerGeneratedArticlesData};
export default {generateArticlesDataFromFaker};

0 comments on commit a0fecb2

Please sign in to comment.