Bug: The initial test for helloWorld fails because the function helloWorld() does not return the expected string "Hello, World!". #512
Labels
Status: Needs Review
This issue/PR needs an initial or additional review
Type: Bug
Involves something that isn't working as intended
Prerequisites
Bug - location of bug: brief description of bug
format, e.g.Bug - Exercises: File type incorrect for all test files
Bug Description
The issue is that the helloWorld() function is either not defined or is incorrectly implemented. You need to implement or modify the function to return the correct string.
How to reproduce the bug
1.Clone or Fork the Repository
Go to the JavaScript Exercises repository.
Clone or fork the repository to your local machine.
git clone https://github.com/TheOdinProject/javascript-exercises.git
2.Navigate to the Exercise Directory
Open the terminal or command prompt and navigate to the 01_helloWorld directory:
cd javascript-exercises/01_helloWorld
3.Run the Test
Run the Jest test for the helloWorld.spec.js file by using the following command:
npm test helloWorld.spec.js
4.Observe the Failure
When the test is run, it will fail with an error message similar to:
PS D:\electron\javascript-exercises> npm test helloWorld.spec.js
FAIL 01_helloWorld/helloWorld.spec.js
Hello World
× says "Hello, World!" (3 ms)
● Hello World › says "Hello, World!"
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 0.297 s, estimated 1 s
Ran all test suites matching /helloWorld.spec.js/i.
Expected Behavior
HelloWorld Function Test
Description
This is a simple test case for the
helloWorld()
function, which verifies that the function correctly returns the string"Hello, World!"
.Steps to Reproduce the Test
1. Run the Test
To run the test for the
helloWorld()
function, use the following command in your terminal:The text was updated successfully, but these errors were encountered: